diff --git a/src/main/jastadd/RelAst.flex b/src/main/jastadd/RelAst.flex index 7cccbe3c484522ca126427e3df9a57681c52d8d4..17049259871bf75b47bc9c5a2ef9d5a4fb4d9932 100644 --- a/src/main/jastadd/RelAst.flex +++ b/src/main/jastadd/RelAst.flex @@ -36,7 +36,7 @@ import org.jastadd.relast.parser.RelAstParser.Terminals; %} WhiteSpace = [ ] | \t | \f | \n | \r | \r\n -TraditionalComment = "/*" [^*] ~"*/" | "/*" "*"+ "/" +TraditionalComment = [/][*][^*]*[*]+([^*/][^*]*[*]+)*[/] EndOfLineComment = "//" [^\n|\r|\r\n]* Comment = {TraditionalComment} | {EndOfLineComment} diff --git a/src/test/jastadd/relations/Relations.relast b/src/test/jastadd/relations/Relations.relast index 892ad39a767a72be44ff1cba5d61c98e2998fa6f..bdcc87885ae227cfd2d384659a8d1d535ee63aa0 100644 --- a/src/test/jastadd/relations/Relations.relast +++ b/src/test/jastadd/relations/Relations.relast @@ -1,3 +1,5 @@ +// do line comments work? + Root ::= A* B*; A ::= <Name> /SomeNTA:A/; B ::= <Name>; @@ -6,6 +8,23 @@ rel A.Di1 -> B; rel A.Di2? -> B; rel A.Di3* -> B; +/* + do multiline comments work +*/ + +/**/ + +/* + * work? +*/ + +/** + * The root of a Java AST. + * + * <p>A Java program consists of multiple compilation units that represent the + * source files of the program. + */ + rel A.Bi1 <-> B.Bi1; rel A.Bi2 <-> B.Bi2?; rel A.Bi3 <-> B.Bi3*;