Fixed: [Issue 184] Scientific notation for float numbers does not
support '+'.
diff --git a/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/bugs/Issue184_AddPlusSignToScientificNotation.java b/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/bugs/Issue184_AddPlusSignToScientificNotation.java
new file mode 100644
index 0000000..5797479
--- /dev/null
+++ b/com.google.eclipse.protobuf.test/src/com/google/eclipse/protobuf/bugs/Issue184_AddPlusSignToScientificNotation.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2011 Google Inc.
+ *
+ * All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse
+ * Public License v1.0 which accompanies this distribution, and is available at
+ *
+ * http://www.eclipse.org/legal/epl-v10.html
+ */
+package com.google.eclipse.protobuf.bugs;
+
+import static com.google.eclipse.protobuf.junit.core.UnitTestModule.unitTestModule;
+import static com.google.eclipse.protobuf.junit.core.XtextRule.overrideRuntimeModuleWith;
+import static org.hamcrest.core.IsEqual.equalTo;
+import static org.hamcrest.core.IsInstanceOf.instanceOf;
+import static org.junit.Assert.assertThat;
+
+import com.google.eclipse.protobuf.junit.core.XtextRule;
+import com.google.eclipse.protobuf.protobuf.*;
+
+import org.junit.*;
+
+/**
+ * Tests fix for <a href="http://code.google.com/p/protobuf-dt/issues/detail?id=184">Issue 184</a>.
+ *
+ * @author alruiz@google.com (Alex Ruiz)
+ */
+public class Issue184_AddPlusSignToScientificNotation {
+ @Rule public XtextRule xtext = overrideRuntimeModuleWith(unitTestModule());
+
+ // syntax = "proto2";
+ //
+ // message Test {
+ // optional float ratio = 1 [default = 1e+25];
+ // }
+ @Test public void should_not_have_syntax_errors() {
+ DefaultValueFieldOption option = xtext.find("default", DefaultValueFieldOption.class);
+ Value value = option.getValue();
+ assertThat(value, instanceOf(DoubleLink.class));
+ DoubleLink link = (DoubleLink) value;
+ assertThat(link.getTarget(), equalTo(1.0E25d));
+ }
+}
diff --git a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/Protobuf.xtext b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/Protobuf.xtext
index e304932..dd947e8 100644
--- a/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/Protobuf.xtext
+++ b/com.google.eclipse.protobuf/src/com/google/eclipse/protobuf/Protobuf.xtext
@@ -257,7 +257,7 @@
terminal DOUBLE returns ecore::EDouble:
('-')? (NUMBER)* ('.' (NUMBER)+)? |
('-')? (NUMBER)+ ('.') |
- ('-')? (NUMBER)+ (('e'|'E')('-')? (NUMBER)+) |
+ ('-')? (NUMBER)+ (('e'|'E')('-'|'+')? (NUMBER)+) |
'nan' | 'inf' | '-inf';
terminal NUMBER: