You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Java import fails if the source file contains string literals where // occurs as substring:
error.lexical in file "D:\SW-Produkte\Structorizer\tests\Issue1151_Java_import_mystic_error\PHPGenerator_2.java"
Preceding source context:
1: public class Test1151
2: {
3:
4: protected String getInputReplacer(boolean withPrompt)
5: {
6: return » "$2 = \\$_REQUEST[$1]; // TODO form a sensible input opportunity";
Found token (Error) (")
Expected:
The same happens if the string literal contains /*, no matter whether or not */ follows within the string literal.
Obviously, the comment detection does not correctly work with the GOLD engine used in Structorizer. Interestingly, the GOLDBuilder successfully parses the very same files using the very same grammar. Hence, it is possible that the Structorizer hack to associate comments to Productions during the parsing is to be blamed for the bug.
The text was updated successfully, but these errors were encountered:
codemanyak
changed the title
Java import failure on string literals containing line comment symbols
Code import failure on string literals containing line comment symbols after a tab character
Mar 20, 2024
codemanyak
changed the title
Code import failure on string literals containing line comment symbols after a tab character
Code import failure on string literals containing tab characters
Mar 20, 2024
It wasn't the comment symbol at all, but just the occurrence of a tab character in the string literal, that causes the failure. And the code passed the GOLDBuilder only because it automatically replaces the tab characters by blanks on loading the file 😠 .
Hence, it's just the grammars that are to be blamed. Apparently the character set {all_printable} does not include tab as member.
Workaround: Replace tab characters in string literals by \t.
Java import fails if the source file contains string literals where
//
occurs as substring:The same happens if the string literal contains
/*
, no matter whether or not*/
follows within the string literal.Obviously, the comment detection does not correctly work with the GOLD engine used in Structorizer. Interestingly, the GOLDBuilder successfully parses the very same files using the very same grammar. Hence, it is possible that the Structorizer hack to associate comments to Productions during the parsing is to be blamed for the bug.
The text was updated successfully, but these errors were encountered: