%YAML 1.2 --- # http://www.sublimetext.com/docs/3/syntax.html name: LiveScript comment: "LiveScript Syntax: version 1" file_extensions: - ls - Slakefile - ls.erb first_line_match: ^#!.*\bls scope: source.livescript contexts: main: - match: |- (?x) !?[~-]{1,2}>\*? |<[~-]{1,2}!? |\(\s* (?= instanceof[\s)]|and[\s)]|or[\s)]|is[\s)]|isnt[\s)]|in[\s)]|import[\s)]|import\ all[\s)] |\.|[-+/*%^&<>=|][\b\s)\w$]|\*\*|\%\%) | (?<=[\s(]instanceof|[\s(]and|[\s(]or|[\s(]is|[\s(]isnt|[\s(]in|[\s(]import|[\s(]import\ all|[\s(]do|\.|\*\*|\%\%|[\b\s(\w$][-+/*%^&<>=|]) \s*\) scope: storage.type.function.livescript - match: \/\* captures: 0: punctuation.definition.comment.livescript push: - meta_scope: comment.block.livescript - match: \*\/ captures: 0: punctuation.definition.comment.livescript pop: true - match: '@\w*' scope: storage.type.annotation.livescriptscript - match: '(#)(?!\{).*$\n?' scope: comment.line.number-sign.livescript captures: 1: punctuation.definition.comment.livescript - match: '((?:!|~|!~|~!)?function\*?)\s+([$\w\-]*[$\w]+)' captures: 1: storage.type.function.livescript 2: entity.name.function.livescript - match: (new)\s+(\w+(?:\.\w*)*) captures: 1: keyword.operator.new.livescript 2: entity.name.type.instance.livescript - match: \b(package|private|protected|public|interface|enum|static)(?!-)\b scope: keyword.illegal.livescript - match: "'''" captures: 0: punctuation.definition.string.begin.livescript push: - meta_scope: string.quoted.heredoc.livescript - match: "'''" captures: 0: punctuation.definition.string.end.livescript pop: true - match: '"""' captures: 0: punctuation.definition.string.begin.livescript push: - meta_scope: string.quoted.double.heredoc.livescript - match: '"""' captures: 0: punctuation.definition.string.end.livescript pop: true - match: \\. scope: constant.character.escape.livescript - include: interpolated_livescript - match: "``" captures: 0: punctuation.definition.string.begin.livescript push: - meta_scope: string.quoted.script.livescript - match: "``" captures: 0: punctuation.definition.string.end.livescript pop: true - match: '\\(x[0-9A-Fa-f]{2}|[0-2][0-7]{0,2}|3[0-6][0-7]|37[0-7]?|[4-7][0-7]?|.)' scope: constant.character.escape.livescript - match: '<\[' push: - meta_scope: string.array-literal.livescript - match: '\]>' pop: true - match: '/{2}(?![\s=/*+{}?]).*?[^\\]/[igmy]{0,4}(?![a-zA-Z0-9])/{2}' scope: string.regexp.livescript - match: '/{2}\n' push: - meta_scope: string.regexp.livescript - match: "/{2}[imgy]{0,4}" pop: true - include: embedded_spaced_comment - include: interpolated_livescript - match: "/{2}" push: - meta_scope: string.regexp.livescript - match: "/{2}[imgy]{0,4}" pop: true - match: '\\(x[0-9A-Fa-f]{2}|[0-2][0-7]{0,2}|3[0-6][0-7]|37[0-7]?|[4-7][0-7]?|.)' scope: constant.character.escape.livescript - include: interpolated_livescript - match: '/(?![\s=/*+{}?]).*?[^\\]/[igmy]{0,4}(?![a-zA-Z0-9])' scope: string.regexp.livescript - match: |- (?x) \b(? scope: keyword.operator.livescript - match: "=>" scope: keyword.control.livescript - match: |- (?x) \b(?)|\+\+|\+| ~(?!~?>)|==|=|!=|<=|>=|<<=|>>=| >>>=|<>|<(?!\[)|(?|(?)|&&|\.\.(\.)?|\s\.\s|\?|\|\||\:|\*=|(?)))\s*(?!(\s*!?\s*\(.*\))?\s*(!?[~-]{1,2}>\*?))' captures: 1: variable.assignment.livescript 3: punctuation.separator.key-value, keyword.operator.livescript 4: keyword.operator.livescript - match: '(?<=\s|^)([\[\{])(?=.*?[\]\}]\s+[:=])' captures: 0: keyword.operator.livescript push: - meta_scope: meta.variable.assignment.destructured.livescript - match: '([\]\}]\s*[:=])' captures: 0: keyword.operator.livescript pop: true - include: variable_name - include: instance_variable - include: single_quoted_string - include: double_quoted_string - include: numeric - match: |- (?x) (\s*) (?=[a-zA-Z\$_]) ([a-zA-Z\$_]([\w$.:-])*)\s* (?=[:=](\s*!?\s*\(.*\))?\s*(!?[~-]{1,2}>\*?)) scope: meta.function.livescript captures: 2: entity.name.function.livescript 3: entity.name.function.livescript 4: variable.parameter.function.livescript 5: storage.type.function.livescript - match: \b(?][ =)]|[`}%*)]|/(?!.*?/)|&&|[.][^.]|=>|\/ +|\||\|\||\-\-|\+\+|\|>|<|\||$|\n|\#|/\*))' captures: 1: meta.function-call.livescript 2: keyword.operator.livescript - match: \| _ scope: keyword.control.livescript - match: '\|(?![.])' scope: keyword.control.livescript - match: \| scope: keyword.operator.livescript - match: ((?<=console\.)(debug|warn|info|log|error|time(End|-end)|assert))\b scope: support.function.console.livescript - match: |- (?x)\b( decodeURI(Component)?|encodeURI(Component)?|eval|parse(Float|Int)|require )\b scope: support.function.livescript - match: |- (?x)(?