{ "name": "JLex", "scopeName": "source.jlex", "patterns": [ { "include": "#main" } ], "repository": { "comments": { "patterns": [ { "name": "comment.line.double-slash.jlex", "begin": "//", "end": "$", "beginCaptures": { "0": { "name": "punctuation.definition.comment.jlex" } } }, { "name": "comment.block.jlex", "begin": "/\\*", "end": "\\*/", "beginCaptures": { "0": { "name": "punctuation.definition.begin.comment.jlex" } }, "endCaptures": { "0": { "name": "punctuation.definition.end.comment.jlex" } } } ] }, "directive": { "patterns": [ { "match": "((%)(?:class|extends|implements|extends|cupsym))\\s+(\\S.*)", "captures": { "1": { "name": "keyword.control.directive.jlex" }, "2": { "name": "punctuation.definition.directive.jlex" }, "3": { "name": "storage.type.class.var.jlex" } } }, { "match": "((%)include)\\s*(\\S.*)(?=$|//)", "captures": { "1": { "name": "keyword.control.directive.jlex" }, "2": { "name": "punctuation.definition.directive.jlex" }, "3": { "patterns": [ { "name": "storage.modifier.import.java", "match": "[^\\s.]+" }, { "name": "punctuation.separator.java", "match": "\\." } ] } } }, { "name": "meta.state-declarations.jlex", "begin": "(%)state(?=\\s)(?!$)", "end": "(?=$|/\\*)", "patterns": [ { "name": "variable.other.definition.jlex", "match": "[A-Za-z_][A-Za-z_0-9]*" }, { "name": "punctuation.delimiter.comma.jlex", "match": "," } ], "beginCaptures": { "0": { "name": "keyword.control.directive.jlex" }, "1": { "name": "punctuation.definition.directive.jlex" } } }, { "name": "meta.code-block.directive.$3.jlex", "begin": "^\\s*((%)(initthrow|init|eofthrow|eofval|eof))({)", "end": "^\\s*((%)\\3)(})", "patterns": [ { "include": "source.java" } ], "beginCaptures": { "1": { "name": "keyword.control.directive.jlex" }, "2": { "name": "punctuation.definition.directive.jlex" }, "4": { "name": "punctuation.definition.curly.bracket.begin.jlex" } }, "endCaptures": { "1": { "name": "keyword.control.directive.jlex" }, "2": { "name": "punctuation.definition.directive.jlex" }, "3": { "name": "punctuation.definition.curly.bracket.end.jlex" } } }, { "begin": "^\\s*((%)\\w+)(\\s+\\S.*)?", "end": "(?=$)", "beginCaptures": { "1": { "name": "keyword.control.directive.jlex" }, "2": { "name": "punctuation.definition.directive.jlex" }, "3": { "patterns": [ { "include": "#comments" }, { "name": "constant.language.other.lex", "match": "\\S+" } ] } } } ] }, "directives": { "name": "name.directives.jlex", "begin": "^\\s*(%%)\\s*$\\s*", "end": "^\\s*(%%)\\s*$\\s*", "patterns": [ { "include": "#passthrough" }, { "include": "#directive" }, { "include": "#comments" }, { "include": "#macro" } ], "beginCaptures": { "1": { "name": "keyword.control.section.begin.jlex" } }, "endCaptures": { "1": { "name": "keyword.control.section.end.jlex" } } }, "macro": { "match": "^\\s*([^\\s=]+)\\s*(=)(\\s*\\S.*)$", "captures": { "1": { "name": "entity.macro.name.jlex" }, "2": { "name": "keyword.operator.assignment.jlex" }, "3": { "name": "meta.macro.definition.jlex", "patterns": [ { "include": "source.lex.regexp" } ] } } }, "main": { "patterns": [ { "include": "#comments" }, { "include": "#user-code" }, { "include": "#directives" }, { "include": "#rules" } ] }, "passthrough": { "name": "meta.code-chunk.jlex", "begin": "^\\s*%{", "end": "^\\s*%}", "patterns": [ { "include": "source.java" } ], "beginCaptures": { "0": { "name": "punctuation.section.embedded.begin.jlex" } }, "endCaptures": { "0": { "name": "punctuation.section.embedded.end.jlex" } } }, "rules": { "patterns": [ { "name": "meta.rule.jlex", "begin": "^\\s*(\"[^\"]+\")\\s+({)", "end": "}", "patterns": [ { "include": "source.java" } ], "beginCaptures": { "1": { "patterns": [ { "include": "source.lex.regexp#string" } ] }, "2": { "name": "punctuation.definition.curly.bracket.begin.jlex" } }, "endCaptures": { "0": { "name": "punctuation.definition.curly.bracket.begin.jlex" } } }, { "name": "meta.rule.jlex", "begin": "^([^{]*[^\\s{][^{]*)({\\w+}\\s*)?({)", "end": "}", "patterns": [ { "include": "source.java" } ], "beginCaptures": { "1": { "patterns": [ { "include": "source.lex.regexp" } ] }, "2": { "patterns": [ { "include": "source.lex.regexp" } ] }, "3": { "name": "punctuation.definition.curly.bracket.begin.jlex" } }, "endCaptures": { "0": { "name": "punctuation.definition.curly.bracket.begin.jlex" } } } ] }, "user-code": { "patterns": [ { "name": "meta.user-code.jlex", "begin": "\\G", "end": "^(?=\\s*%%)", "patterns": [ { "include": "source.java" } ] } ] } } }