Bug 387853 - Syntax error generated by variable named "double"
diff --git a/org.eclipse.photran.core.vpg.tests/parser-test-code/reg_tests/bug387853.f90 b/org.eclipse.photran.core.vpg.tests/parser-test-code/reg_tests/bug387853.f90
new file mode 100644
index 0000000..6cee310
--- /dev/null
+++ b/org.eclipse.photran.core.vpg.tests/parser-test-code/reg_tests/bug387853.f90
@@ -0,0 +1,7 @@
+program main
+    implicit none
+    integer :: double
+
+    ! Generates sytax error "Unexpected equals"
+    double = 5
+end program
diff --git a/org.eclipse.photran.core.vpg/lexer/org/eclipse/photran/internal/core/lexer/FreeFormLexerPhase2.java b/org.eclipse.photran.core.vpg/lexer/org/eclipse/photran/internal/core/lexer/FreeFormLexerPhase2.java
index 5a87fbd..4c7a3b1 100644
--- a/org.eclipse.photran.core.vpg/lexer/org/eclipse/photran/internal/core/lexer/FreeFormLexerPhase2.java
+++ b/org.eclipse.photran.core.vpg/lexer/org/eclipse/photran/internal/core/lexer/FreeFormLexerPhase2.java
@@ -1021,9 +1021,13 @@
             }
 
             // We didn't follow a comma or :: and we're at paren level 0:
-            // This is the identifier!
             else
             {
+                // If this is an assignment like "double = 5", there is no declaration
+                if (openContextEquals)
+                    return null;
+
+                // This is the identifier!
                 declIdentifierPos = i;
                 break;
             }