commit | 1f1eb197ccba7d986f9ae9f3c7dbdbfc8fa7d961 | [log] [tgz] |
---|---|---|
author | Jeffrey Overbey <jeffreyoverbey@acm.org> | Thu May 21 11:02:43 2015 -0500 |
committer | Jeffrey Overbey <jeffreyoverbey@acm.org> | Thu May 21 11:02:43 2015 -0500 |
tree | f64705758225e8b7456f82fca7740ad50c01c883 | |
parent | 58a3791e858e9e3264a91c3e7e5e68ab796856ee [diff] |
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; }