%YAML 1.2 --- name: Za first_line_match: \/bin\/za scope: source.za contexts: main: - include: comment - include: string_quoted_backtick - include: string_quoted_double - include: string_quoted_single #- include: string_regex - include: inline_comment - include: variable - include: number_hex - include: number_octal - include: number_bin - include: number_int - include: keyword - include: keyword_type - include: function_params - include: function_definition - include: function_call - include: function - include: expr comment: - match: \#.*$\n? scope: comment.line.quotes.za captures: 1: punctuation.definition.comment.za expr: - match: (\|\||&&|==(\?|#)?|(!|>|<)=(#|\?)?|(=|!)~(#|\?)?|(>|<)(#|\?)|\.|\*|\\|%) scope: storage.function.za function: - match: \b(de(f|fine)?|en(d|ddef)?)\b scope: storage.function.za function_call: - match: '(([sgbwtl]|)?:?[0-9a-zA-Z_#]+)(?=\()' scope: support.function.any-method function_definition: - match: '^\s*(function)\s*!?\s+(?=(s:)?[0-9a-zA-Z_#]+\s*\()' captures: 1: storage.function.za push: - meta_scope: meta.function.za - match: (\() captures: 1: punctuation.definition.parameters.begin.za pop: true - match: "(s:)?[0-9a-zA-Z_#]+" scope: entity.name.function.za function_params: - match: '-\w+=' scope: support.type.za inline_comment: - match: '(?!\$)(#)(?!\{).*$\n?' scope: comment.line.quotes.za captures: 1: punctuation.definition.comment.za keyword: - match: \b(NaN|and|any|array|as|assert|async|at|bigf|bigi|bool|break|case|catch|cls|contains|continue|debug|def|define|do|doc|ec|ef|ei|else|end|endcase|enddef|endfor|endif|endstruct|endtest|endtry|endwhile|endwith|enum|es|et|ew|exit|false|float|for|foreach|has|help|hist|if|in|init|input|int|is|lib|log|logging|loud|macro|map|module|namespace|nil|nop|not|number|on|or|pane|pause|pointer|print|println|prompt|quiet|require|return|setglob|showdef|showstruct|step|string|struct|test|then|throw|throws|to|true|try|uint|unset|use|uses|var|version|while|with)\b scope: keyword.control.za number_int: - match: '-?\d+' scope: constant.numeric.integer number_hex: - match: "0(x|X)[0-9a-fA-F]+" scope: constant.numeric.hex number_octal: - match: "0(o|O)[0-7]+" scope: constant.numeric.octal number_bin: - match: "0(b|B)[01]+" scope: constant.numeric.binary keyword_type: - match: \b(any|array|bigf|bigi|bool|float|int|map|number|pointer|string|uint)\b scope: keyword.type.za string_quoted_backtick: - match: '`(\\\\|\\`|\n[^\S\n]*\\|[^\n`])*"' scope: string.quoted.backtick.za string_quoted_double: - match: '"(\\\\|\\"|\n[^\S\n]*\\|[^\n"])*"' scope: string.quoted.double.za string_quoted_single: - match: '''(''''|\n[^\S\n]*\\|[^\n''])*''' scope: string.quoted.single.za string_regex: - match: '/(\\\\|\\/|\n[^\S\n]*\\|[^\n/])*/' scope: string.regexp.za variable: - match: '([sSgGbBwWlLaAvV]:|@|$|&(?!&))\w*' scope: variable.other.za