diff --git a/parsers/lib/antlr4/LangOMPLexer.g4 b/parsers/lib/antlr4/LangOMPLexer.g4 index 1ca210841a..9e0fe1a44f 100644 --- a/parsers/lib/antlr4/LangOMPLexer.g4 +++ b/parsers/lib/antlr4/LangOMPLexer.g4 @@ -10,7 +10,7 @@ OMP_PRAGMA mode OMP; OMP_PRAGMA_END - : '\n' -> mode(DEFAULT_MODE), skip; + : ('\n' | '\r\n') -> mode(DEFAULT_MODE), skip; OMP_WHITESPACE : OMP_WS -> skip; diff --git a/parsers/lib/antlr4/LangPVLParser.g4 b/parsers/lib/antlr4/LangPVLParser.g4 index 6d0d7e749f..287551fe21 100644 --- a/parsers/lib/antlr4/LangPVLParser.g4 +++ b/parsers/lib/antlr4/LangPVLParser.g4 @@ -9,7 +9,7 @@ program : programDecl* block? EOF ; programDecl : claz|kernel|block|field|methodDecl ; claz : contract 'class' identifier '{' clazMember* '}' ; -clazMember : methodDecl | constructor | field; +clazMember : constructor | methodDecl | field; kernel : 'kernel' identifier '{' kernelMember* '}' ; kernelMember : kernelField | methodDecl ; diff --git a/parsers/src/main/java/vct/parsers/PVLtoCOL.scala b/parsers/src/main/java/vct/parsers/PVLtoCOL.scala index 35428105da..8193b27b95 100644 --- a/parsers/src/main/java/vct/parsers/PVLtoCOL.scala +++ b/parsers/src/main/java/vct/parsers/PVLtoCOL.scala @@ -54,8 +54,8 @@ case class PVLtoCOL(fileName: String, tokens: CommonTokenStream, parser: PVLPars case ProgramDecl3(field) => ??(tree) // This is global state? case ProgramDecl4(method_decl) => ??(tree) // Global method? - case ClazMember0(method) => Seq(convertMethod(method)) - case ClazMember1(constructor) => Seq(convertConstructor(constructor)) + case ClazMember0(constructor) => Seq(convertConstructor(constructor)) + case ClazMember1(method) => Seq(convertMethod(method)) case ClazMember2(field) => convertField(field) case KernelMember0(field) => convertKernelField(field)