Prexonite, a .NET hosted scripting language with a focus on meta-programming and embedded DSLs
0

Configure Feed

Select the types of activity you want to include in your feed.

Add `Prexonite Script.sublime-syntax`

Christian Klauser (Dec 28, 2020, 9:54 PM +0100) 780e4947 3ca48368

+252
+252
Prexonite Script.sublime-syntax
··· 1 + %YAML 1.2 2 + --- 3 + # http://www.sublimetext.com/docs/3/syntax.html 4 + name: Prexonite Script 5 + file_extensions: 6 + - pxs 7 + scope: source.pxs 8 + contexts: 9 + main: 10 + - include: global 11 + any: 12 + - include: comments 13 + - match: '(?i)(?<!\.)\b(is|not|as)\b(?!\$|''|\\|\p{Alnum})' 14 + scope: keyword.operator.source.pxs 15 + any-low: 16 + - include: storage-keywords 17 + - match: '(?i)(?<!\.)\bdeclare\b(?!\$|''|\\|\p{Alnum})' 18 + scope: keyword.other.declare.source.pxs 19 + - include: identifiers 20 + - match: \( 21 + comment: parentheses introduces local 22 + captures: 23 + 0: punctuation.parentheses.opening.source.pxs 24 + push: 25 + - match: \) 26 + captures: 27 + 0: punctuation.parentheses.closing.source.pxs 28 + pop: true 29 + - include: local 30 + - match: '\{' 31 + comment: block 32 + captures: 33 + 0: punctuation.braces.opening.source.pxs 34 + push: 35 + - meta_scope: block.source.source.pxs 36 + - match: '\}' 37 + captures: 38 + 0: punctuation.braces.closing.source.pxs 39 + pop: true 40 + - include: local 41 + - include: smart-strings 42 + asm: 43 + - include: comments 44 + - include: numeric-constants 45 + - include: version-literals 46 + - include: boolean-constants 47 + boolean-constants: 48 + - match: '\b(true|false)\b(?!\$|''|\\|\p{Alnum})' 49 + scope: constant.language.source.pxs 50 + comments: 51 + - match: // 52 + push: 53 + - meta_scope: comment.line.double-slash.source.pxs 54 + - match: \n 55 + pop: true 56 + - match: /\* 57 + push: 58 + - meta_scope: comment.block.source.pxs 59 + - match: \*/ 60 + pop: true 61 + dumb-strings: 62 + - match: '"' 63 + captures: 64 + 0: punctuation.string.doublequotes.source.pxs 65 + push: 66 + - meta_scope: string.quoted.double.escaped.source.pxs 67 + - match: '"' 68 + captures: 69 + 0: punctuation.string.doublequotes.source.pxs 70 + pop: true 71 + - include: escape-sequences 72 + - match: '@"' 73 + captures: 74 + 0: punctuation.string.doublequotes.source.pxs 75 + push: 76 + - meta_scope: string.quoted.double.verbatim.source.pxs 77 + - match: '"' 78 + captures: 79 + 0: punctuation.string.doublequotes.source.pxs 80 + pop: true 81 + - include: verbatim-escape-sequences 82 + escape-sequences: 83 + - match: '\\([\\"&0abfnrvt$])' 84 + scope: constant.character.escape.source.pxs 85 + - match: '\\x\h{1,4}' 86 + scope: constant.character.escape.unicode.source.pxs 87 + - match: '\\u\h{4}' 88 + scope: constant.character.escape.unicode.source.pxs 89 + - match: '\\U\h{8}' 90 + scope: constant.character.escape.unicode.source.pxs 91 + global: 92 + - include: any 93 + - match: '(?i)(?<!\.)\b(add|to|namespace|build|import|export|enabled|disabled)\b(?!\$|''|\\|\p{Alnum})' 94 + comment: Keywords that are only valid on a global scope. (Related to meta, usually) 95 + scope: keyword.other.meta.source.pxs 96 + - match: "=" 97 + comment: assigment introduces local 98 + captures: 99 + 0: keyword.operator.assigment.source.pxs 100 + push: 101 + - match: ; 102 + pop: true 103 + - include: local 104 + - match: '\[' 105 + push: 106 + - meta_scope: block.meta.source.pxs 107 + - match: '\]' 108 + pop: true 109 + - include: meta 110 + - include: any-low 111 + identifiers: 112 + - match: \$" 113 + captures: 114 + 0: punctuation.string.doublequotes.source.pxs 115 + push: 116 + - meta_content_scope: variable.other.identifier.source.pxs 117 + - match: '"' 118 + captures: 119 + 0: punctuation.string.doublequotes.source.pxs 120 + pop: true 121 + - include: escape-sequences 122 + - match: '\$((\p{Alnum}|\\|\$|''|_|::)+)' 123 + captures: 124 + 1: variable.other.identifier.source.pxs 125 + - match: \$ 126 + scope: variable.other.identifier.source.pxs 127 + - match: '(\p{Alpha}|\\|''|_)(\p{Alnum}|\\|\$|''|_|::)*' 128 + scope: variable.other.identifier.source.pxs 129 + interpolation: 130 + - match: '(\$)((\p{Alnum}|\\|''|\$|_)+)(&?)' 131 + comment: Single identifier interpolation 132 + scope: string.interpolated.identifier.source.pxs 133 + captures: 134 + 1: punctuation.string.interpolated.source.pxs 135 + 2: variable.other.source.pxs 136 + 4: punctuation.string.interpolated.source.pxs 137 + - match: \$\( 138 + comment: Expression interpolation, originally 139 + captures: 140 + 0: punctuation.string.interpolated.source.pxs 141 + push: 142 + - meta_content_scope: string.interpolated.expression.source.pxs 143 + - match: \) 144 + captures: 145 + 0: punctuation.string.interpolated.source.pxs 146 + pop: true 147 + - include: local 148 + local: 149 + - include: any 150 + - include: null-literal 151 + - match: (?i)(?<!\.)\b(static)\b 152 + scope: storage.modifier.source.pxs 153 + - match: '(?i)(?<!\.)\b(if|else|unless|while|until|do|for|foreach|in|using|throw|try|catch|finally|return|yield|break|continue|this|method|namespace|import|export)\b(?!\$|''|\\|\p{Alnum})' 154 + scope: keyword.control.source.pxs 155 + - match: '(?i)(?<!\.)\b(and|or|mod|coroutine|as|new)\b(?!\$|''|\\|\p{Alnum})' 156 + scope: keyword.operator.source.pxs 157 + - match: (\+|-|\+\+|--|\*|/|==|!=|<|>|<=|>=|\|>|<\||=>|\?|\.|:|\^|\||&|=|\?\?|>>|<<|->) 158 + scope: keyword.operator.source.pxs 159 + - match: (?i)(?<!\.)\b(asm)\s*\( 160 + comment: Inline assembler expression 161 + captures: 162 + 1: keyword.other.asm.source.pxs 163 + push: 164 + - meta_scope: block.asm.source.pxs 165 + - match: \) 166 + pop: true 167 + - include: asm 168 + - match: '(?i)(?<!\.)\b(asm)\s*\{' 169 + comment: Inline assembler block 170 + captures: 171 + 1: keyword.other.asm.source.pxs 172 + push: 173 + - meta_scope: block.asm.source.pxs 174 + - match: '\}' 175 + pop: true 176 + - include: asm 177 + - match: '\[' 178 + push: 179 + - meta_scope: block.meta.source.pxs 180 + - match: '\]' 181 + pop: true 182 + - include: local 183 + - include: any-low 184 + meta: 185 + - include: comments 186 + - include: boolean-constants 187 + - include: version-literals 188 + - include: numeric-constants 189 + - include: dumb-strings 190 + - match: '(?i)(?<!\.)\b(is|enabled|disabled|not)\b(?!\$|''|\\|\p{Alnum})' 191 + scope: keyword.other.meta.source.pxs 192 + - include: identifiers 193 + - match: '\{' 194 + comment: meta list 195 + captures: 196 + 0: punctuation.braces.opening.source.pxs 197 + push: 198 + - meta_scope: list.meta.source.source.pxs 199 + - match: '\}' 200 + captures: 201 + 0: punctuation.braces.closing.source.pxs 202 + pop: true 203 + - include: meta 204 + null-literal: 205 + - match: (?i)\b(?<!\.)null\b 206 + scope: constant.language.nullptr.source.pxs 207 + numeric-constants: 208 + - match: '\b(\d(\d|'')*)?\.(\d(\d|'')*)[eE][-]?(\d(\d|'')*)\b' 209 + scope: constant.numeric.real.source.pxs 210 + - include: real-like-constant 211 + - match: '\b(\d(\d|'')*)\b|\b0x((\d|[A-Fa-f])(\d|''|[A-Fa-f])*)\b' 212 + scope: constant.numeric.integer.source.pxs 213 + operator-shortnames: 214 + - match: (?i)\((\+|-|\*|/|(?<!\.)mod|\^|&|\|(?<!\.)xor|==|!=|>|>=|<=|<|-\.|\+\+|--)\) 215 + comment: These are treated specially, because they are identifiers from a lexical standpoint. 216 + scope: keyword.operator.shortname.source.pxs 217 + real-like-constant: 218 + - match: \b(\d(\d|')*)\.(\d(\d|')*)\b 219 + scope: constant.numeric.real_like.source.pxs 220 + smart-strings: 221 + - match: '"' 222 + captures: 223 + 0: punctuation.string.doublequotes.source.pxs 224 + push: 225 + - meta_scope: string.quoted.double.escaped.source.pxs 226 + - match: '"' 227 + captures: 228 + 0: punctuation.string.doublequotes.source.pxs 229 + pop: true 230 + - include: escape-sequences 231 + - include: interpolation 232 + - match: '@"' 233 + captures: 234 + 0: punctuation.string.doublequotes.source.pxs 235 + push: 236 + - meta_scope: string.quoted.double.verbatim.source.pxs 237 + - match: '"' 238 + captures: 239 + 0: punctuation.string.doublequotes.source.pxs 240 + pop: true 241 + - include: verbatim-escape-sequences 242 + - include: interpolation 243 + storage-keywords: 244 + - match: '(?i)(?<!\.)\b(var|ref|function|command|macro|lazy)\b(?!\$|''|\\|\p{Alnum})' 245 + scope: storage.type.interpretation.source.pxs 246 + verbatim-escape-sequences: 247 + - match: '""' 248 + scope: constant.character.escape.source.pxs 249 + version-literals: 250 + - match: \b(\d(\d|')*)\.(\d(\d|')*)\.(\d(\d|')*)(\.(\d(\d|')*))?\b 251 + scope: constant.numeric.version.source.pxs 252 + - include: real-like-constant