diff --git a/src/style.css b/src/style.css index 406bf72..33fd9eb 100644 --- a/src/style.css +++ b/src/style.css @@ -353,11 +353,19 @@ option { font-weight: bold; } -.Math > .VARIABLE, -.Math > .STRING { +.Math > .COMMENT, +.Math > .LINE_COMMENT { + color:gray; +} + +.Math > .VARIABLE { color:var(--fg-color); } +.Math > .STRING { + color:var(--code-green-color); +} + .Math > .LPAREN , .Math > .RPAREN , .Math > .LBRACE, @@ -401,6 +409,11 @@ option { color:var(--code-red-color); font-weight: bold; } +.Sequence > .COMMENT, +.Sequence > .LINE_COMMENT +{ + color:gray; +} .GraphPlanar > .STRING, .GraphPlanar > .ID { diff --git a/src/translator/flowchart/Flowchart.g4 b/src/translator/flowchart/Flowchart.g4 index a69b124..c29e7df 100644 --- a/src/translator/flowchart/Flowchart.g4 +++ b/src/translator/flowchart/Flowchart.g4 @@ -2,8 +2,8 @@ grammar Flowchart; // Ignored TOKENS WS: [ \t\n]+ -> channel(HIDDEN); -COMMENT: '/*' .*? '*/' -> channel(HIDDEN); -LINE_COMMENT: '//' .*? ('\r'? '\n' | EOF) -> channel(HIDDEN); +COMMENT: '/' '*' .*? '*' '/' -> channel(HIDDEN); +LINE_COMMENT: '/' '/' (~('\n'))* -> channel(HIDDEN); SEMICOLON: ';'; PL: '('; diff --git a/src/translator/math/Math.g4 b/src/translator/math/Math.g4 index 322500c..3097b6d 100644 --- a/src/translator/math/Math.g4 +++ b/src/translator/math/Math.g4 @@ -86,9 +86,13 @@ EQ : '=' ; POW : '^' ; SUBSCRIPT: '_' ; EOL : '\r\n' | '\n' ; -WS : [ \t]+ -> channel(HIDDEN); fragment CHAR : ~[!+-<>=_^(){}[\] \t\r\n"*] | [.0123456789]; VARIABLE: CHAR+; +// Ignored TOKENS +WS: [ \t]+ -> channel(HIDDEN); +COMMENT: '/' '*' .*? '*' '/' -> channel(HIDDEN); +LINE_COMMENT: '/' '/' .*? ('\n' | EOF) -> channel(HIDDEN); + // vim: filetype=antlr diff --git a/src/translator/sequence/Sequence.g4 b/src/translator/sequence/Sequence.g4 index ba7cac7..321033e 100644 --- a/src/translator/sequence/Sequence.g4 +++ b/src/translator/sequence/Sequence.g4 @@ -2,6 +2,11 @@ grammar Sequence; // Lexer ----- +// Ignored TOKENS +WS: [\t]+ -> channel(HIDDEN); +COMMENT: '/' '*' .*? '*' '/' -> channel(HIDDEN); +LINE_COMMENT: '/' '/' (~('\n'))* -> channel(HIDDEN); + ARROW_RIGHT: '->'; ARROW_LEFT: '<-'; COMMA: ':';