diff --git a/build.gradle b/build.gradle index b326958..a85cb17 100644 --- a/build.gradle +++ b/build.gradle @@ -52,7 +52,7 @@ dependencies { compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" compile 'com.intellij:annotations:5.1' compile 'com.github.daemontus:kotlin-option-result:1.0.0' - antlr "org.antlr:antlr4:4.5.1-1" + antlr "org.antlr:antlr4:4.6" } sourceSets { diff --git a/src/main/antlr/com/github/sybila/ctl/antlr/CTL.g4 b/src/main/antlr/com/github/sybila/ctl/antlr/CTL.g4 index 2ee892b..027945d 100755 --- a/src/main/antlr/com/github/sybila/ctl/antlr/CTL.g4 +++ b/src/main/antlr/com/github/sybila/ctl/antlr/CTL.g4 @@ -97,8 +97,8 @@ FLOAT_VAL : [-]?[0-9]*[.]?[0-9]+; NEWLINE : '\r'?'\n'; -WS : [ \t\u]+ -> channel(HIDDEN) ; +WS : [ \t]+ -> channel(HIDDEN) ; Block_comment : '/*' (Block_comment|.)*? '*/' -> channel(HIDDEN) ; // nesting allow -C_Line_comment : '//' .*? ('\n' | EOF) -> channel(HIDDEN) ; -Python_Line_comment : '#' .*? ('\n' | EOF) -> channel(HIDDEN) ; \ No newline at end of file +C_Line_comment : '//' ~('\n')* -> channel(HIDDEN) ; +Python_Line_comment : '#' ~('\n')* -> channel(HIDDEN) ; \ No newline at end of file diff --git a/src/main/antlr/com/github/sybila/huctl/antlr/HUCTL.g4 b/src/main/antlr/com/github/sybila/huctl/antlr/HUCTL.g4 index 53cd30f..5a351ad 100644 --- a/src/main/antlr/com/github/sybila/huctl/antlr/HUCTL.g4 +++ b/src/main/antlr/com/github/sybila/huctl/antlr/HUCTL.g4 @@ -144,7 +144,7 @@ FLOAT_VAL : [-]?[0-9]*[.]?[0-9]+; NEWLINE : '\r'?'\n'; -WS : [ \t\u]+ -> channel(HIDDEN) ; +WS : [ \t]+ -> channel(HIDDEN) ; Block_comment : '/*' (Block_comment|.)*? '*/' -> channel(HIDDEN) ; // nesting allow C_Line_comment : '//' .*? ('\n' | EOF) -> channel(HIDDEN) ;