Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Converted Pawn.sublime-syntax
%YAML 1.2
---
# source: https://github.com/Southclaws/pawn-sublime-language/blob/b83dab341b1da7af10937a61d49349009c30f1ee/Pawn.tmLanguage
name: Pawn
comment: |
https://github.com/abusalimov/SublimeCImproved
Derived from C.tmLanguage - the original TextMate and Sublime Text
syntax definition.
The MIT License (MIT)
Copyright (c) 2013-2014 Eldar Abusalimov
Modified for the Pawn Language by Sergei Marochkin 2016
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
file_extensions:
- p
- pwn
- inc
first_line_match: '-[*]-( Mode:)? C -[*]-'
scope: source.pawn
contexts:
main:
- include: translation_unit
block:
- match: '(?=\{)'
push:
- match: '\}'
pop: true
- include: block-lookahead-end
block-lookahead-end:
- match: '\{'
push:
- meta_scope: meta.block.c
- match: '(?=\})'
pop: true
- include: lex
- include: call
- include: support
- include: function
- include: $top_level_main
call:
- match: |-
(?x)
\s*
(?= # don't consume to recognize support functions
(?: [A-Za-z_@]\w*+ | ::[^:] )++
(?:\s|/\*.*?\*/)*+ \( )
push:
- meta_scope: meta.function-call.c
- match: \)
pop: true
- include: lex
- match: '(?:(?<=\.)|(?<=->))\b([A-Za-z_@]\w*+)\b'
scope: variable.other.dot-access.c support.function.any-method.c
- match: '(?:[A-Za-z_@]\w*+|::[^:])++'
scope: support.function.any-method.c
- include: parens-lookahead-end
comment-banner-line:
- match: '(?:(?<=//)|(?<=/\*)|^)[\s/*]*(=+\s*(.*?)\s*=+(?:(?=[\s/*+\-]*\*/)|$(\n?)))'
captures:
1: meta.toc-list.banner.c
3: punctuation.whitespace.newline.c
comment-innards:
- include: comment-banner-line
- include: comment-task-tag-line
- include: lex-continuation
- include: lex-newline
comment-task-tag-line:
- match: |-
(?ix)
(?= (?-i: @[a-zA-Z_]++ | \b [A-Z_]++) \b) @? \b (?:
(FIXME) | (XXX) | (WTF)
) \b
captures:
0: keyword.other.task-tag.prio-high.c
1: storage.type.class.fixme.c
2: storage.type.class.xxx.c
3: storage.type.class.wtf.c
push:
- meta_scope: meta.toc-list.task-tag.prio-high.c
- match: '(?=[\s/*]*\*/)|(?<=$\n)'
pop: true
- include: comment-task-tag-line-innards
- match: |-
(?ix)
(?= (?-i: @[a-zA-Z_]++ | \b [A-Z_]++) \b) @? \b (?:
(TODO)
) \b
captures:
0: keyword.other.task-tag.prio-normal.c
1: storage.type.class.todo.c
push:
- meta_scope: meta.toc-list.task-tag.prio-normal.c
- match: '(?=[\s/*]*\*/)|(?<=$\n)'
pop: true
- include: comment-task-tag-line-innards
- match: |-
(?ix)
(?= (?-i: @[a-zA-Z_]++ | \b [A-Z_]++) \b) @? \b (?:
(TBD) | (REVIEW)
) \b
captures:
0: keyword.other.task-tag.prio-low.c
1: storage.type.class.tbd.c
2: storage.type.class.review.c
push:
- meta_scope: meta.toc-list.task-tag.prio-low.c
- match: '(?=[\s/*]*\*/)|(?<=$\n)'
pop: true
- include: comment-task-tag-line-innards
- match: |-
(?ix)
(?= (?-i: @[a-zA-Z_]++ | \b [A-Z_]++) \b) @? \b (?:
(NOTE) | (NB) | (CHANGED) | (IDEA) | (IMPORTANT) | (HACK) | (BUG)
) \b
captures:
0: keyword.other.task-tag.note.c
1: storage.type.class.note.c
2: storage.type.class.nb.c
3: storage.type.class.changed.c
4: storage.type.class.idea.c
5: storage.type.class.important.c
6: storage.type.class.hack.c
7: storage.type.class.bug.c
push:
- meta_scope: meta.toc-list.task-tag.note.c
- match: '(?=[\s/*]*\*/)|(?<=$\n)'
pop: true
- include: comment-task-tag-line-innards
comment-task-tag-line-innards:
- include: comment-task-tag-line
- include: lex-continuation
- include: lex-newline
comments:
- match: \s*(/\*)
captures:
1: punctuation.definition.comment.block.c
push:
- meta_scope: comment.block.c
- match: (\*/)(\n?)
captures:
2: punctuation.whitespace.newline.c
pop: true
- include: comment-innards
- match: '\*/(?![/*])'
scope: invalid.illegal.stray-comment-end.c
- match: \s*(//)
captures:
1: punctuation.definition.comment.line.double-slash.c++
push:
- meta_scope: comment.line.double-slash.c++
- match: (?<=$\n)(?<!\\$\n)
pop: true
- include: comment-innards
function:
- include: function-fixup-macro
- include: function-declaration
- include: function-definition
function-declaration:
- match: |-
(?x)
(?: ^
| (?<! (?<!\w) new
| (?<!\w) (?:else|enum) | (?<!\w) (?:class|union)
| (?<!\w) (?:struct|return|sizeof|typeof)
| (?<!\w) __typeof | (?<!\w) __typeof__ )
(?<= \w ) \s
| # or type modifier / closing bracket before name
(?<= [^&]& | [*>)}\]] ) ) \s*
( (?: [A-Za-z_@]\w*+ | ::[^:] )++
(?: (?<= ^ operator | \W operator ) # C++ operator?
(?: [-*&<>=+!]+ | \(\) | \[\] ) )? )
(?= (?:\s|/\*.*?\*/)*+ (?'parens' \(
(?> \g'parens' |
"(\\.|[^"])*" | '(\\.|[^'])*' | /\*.*?\*/ |
(?! /[/*] | [()] ) . )*
\) ) \s* ; )
captures:
1: entity.name.function.declaration.c
push:
- meta_scope: meta.function.c
- match: ;
pop: true
- include: lex
- include: parens
function-definition:
- match: |-
(?x)
(?: ^
| (?<! (?<!\w) new
| (?<!\w) (?:else|enum) | (?<!\w) (?:class|union)
| (?<!\w) (?:struct|return|sizeof|typeof)
| (?<!\w) __typeof | (?<!\w) __typeof__ )
(?<= \w ) \s
| # or type modifier / closing bracket before name
(?<= [^&]& | [*>)}\]\:] ) ) \s*
( (?: [A-Za-z_@]\w*+ | ::[^:] )++
(?: (?<= ^ operator | \W operator ) # C++ operator?
(?: [-*&<>=+!]+ | \(\) | \[\] ) )? )
(?= (?:\s|/\*.*?\*/)*+ \( )
captures:
1: entity.name.function.definition.c
push:
- meta_scope: meta.function.c
- match: '\}|;'
pop: true
- include: lex
- include: parens
- match: \s*\b(const|override)\b
scope: storage.modifier.c
- include: block-lookahead-end
function-fixup-macro:
- match: |-
(?x)
^ # Begin of line, capital letters: most probably it is a macro
\s*\b
([A-Z0-9_]++)
\b
(?= (?:\s|/\*.*?\*/)*+ \( )
push:
- match: \)
pop: true
- include: lex
- include: parens-lookahead-end
lex:
- include: lex-in-preprocessor
- include: preprocessor
lex-constant:
- match: \s*\b(true|false|TRUE|FALSE)\b
captures:
1: constant.language.c
lex-continuation:
- match: (\\)$(\n?)
scope: punctuation.separator.continuation.c
captures:
1: keyword.other.line-continuation.c
2: punctuation.whitespace.newline.c
- match: \\(\s+?)(?=\n)$
captures:
1: invalid.deprecated.space-after-continuation.c
lex-core:
- include: comments
- include: lex-continuation
- include: lex-newline
- include: lex-number
- include: lex-string
lex-in-preprocessor:
- include: lex-core
- include: lex-keyword
- include: support-keyword
- include: lex-constant
lex-keyword:
- match: \s*\b(defined)\b
captures:
1: keyword.other.preprocessor.c
- match: \s*\b(sizeof|tagof)\b
captures:
1: keyword.operator.c
- match: (Iterator:)(\t)
captures:
2: invalid.illegal.invalid-indentation
- match: ^\s*(case)\s+
captures:
1: keyword.control.c
push:
- match: '(:)|(?<=^|[^\\])\s*(\n)'
captures:
1: keyword.operator.ternary.c
pop: true
- include: lex-core
- match: \s*\b(assert|break|case|continue|default|do|else|exit|for|goto|if|return|sleep|state|switch|while)\b
captures:
1: keyword.control.c
- match: \s*\b(new|enum)\b
captures:
1: storage.type.c
- match: \s*\b(public|forward|native|char|const|static|stock|hook|task|ptask)\b
captures:
1: storage.modifier.c
- match: '([A-Za-z_]\w*)\:'
scope: storage.modifier.c
- match: (\-|\+|\*|\/|%|&|\||\^|<<|>>)?=
scope: keyword.operator.assignment.c
- match: (==|!=|<=|>=|<>|<|>)
scope: keyword.operator.comparison.c
- match: (\-\-|\+\+)
scope: keyword.operator.increment-decrement.c
- match: (\?|:)
scope: keyword.operator.ternary.c
- match: (\-|\+|\*|\/|%)
scope: keyword.operator.arithmetic.c
- match: (!|&&|\|\|)
scope: keyword.operator.logical.c
- match: (~|&|\||\^|<<|>>)
scope: keyword.operator.bitwise.c
lex-newline:
- match: $\n
scope: punctuation.whitespace.newline.c
lex-number:
- match: '([0-9]+)(\.{2})([0-9]+)'
captures:
1: constant.numeric.integer.decimal.c
2: keyword.operator.switch-range.c
3: constant.numeric.integer.decimal.c
- match: |-
(?ix) # hexadecimal float
(?<!\.) \b
(0x)
# significand
(?: (\.) (?=p) # invalid
| [0-9a-f]*+ ([0-9a-z]*?) [0-9a-f]*+
(?: \. [0-9a-f]*+ ([0-9a-z.]*?) [0-9a-f]*+ )? )
# exponent (required)
(?: (p) (?: [+\-] [0-9]++ ([0-9a-z]*?)
| (?=[0-9a-z.]) [0-9]*+ ([0-9a-z.]*?) )
| (p) )
# remaining valid chars and type
[0-9]*+ ([fl]?)
\b (?!\.)
scope: constant.numeric.float.hexadecimal.c
captures:
1: storage.type.number.prefix.hexadecimal.c
2: invalid.illegal.number.missing-fragment.significand.c
3: invalid.illegal.numeric-literal-character.float.whole-number.c
4: invalid.illegal.numeric-literal-character.float.fraction.c
5: keyword.other.exponent.hexadecimal.c
6: invalid.illegal.numeric-literal-character.float.exponent.c
7: invalid.illegal.numeric-literal-character.float.exponent.c
8: invalid.illegal.number.missing-fragment.exponent.c
9: storage.type.number.suffix.float.c
- match: |-
(?ix) # hexadecimal float without required exponent
(?<!\.) \b
(0x)
# significand (at least a period)
[0-9a-f]*+ ([0-9a-z&&[^p]]*?) [0-9a-f]*+
(\.) [0-9a-f]*+ ([0-9a-z.&&[^p]]*?) [0-9a-f]*+
# type
(l?)
(?:(?<=\.)|\b) (?!\.)
scope: constant.numeric.float.hexadecimal.c
captures:
1: storage.type.number.prefix.hexadecimal.c
2: invalid.illegal.numeric-literal-character.float.whole-number.c
3: invalid.illegal.number.hexadecimal-float-requires-exponent.c
4: invalid.illegal.numeric-literal-character.float.fraction.c
5: storage.type.number.suffix.float.c
- match: |-
(?ix) # decimal float literal
(?<!\.) (?:(?=\.)|\b)
(?!0x)
# significand
(?: (?: [0-9]++ ([0-9a-z&&[^e]]*?) [0-9]*+ )?
\. [0-9]++ ([0-9a-z.&&[^e]]*?) [0-9]*+
| [0-9]++ ([0-9a-z&&[^e]]*?) [0-9]*+ (?: \. | (?=e)) )
# exponent (optional)
(?: (e) (?: [+\-] [0-9]++ ([0-9a-z]*?)
| [0-9]++ ([0-9a-z.]*?) )
| ( p [+\-]? [0-9]++
| [ep] [0-9a-z.]*?) )?
# any invalid chars and type
([0-9a-z]*?) [0-9]*+ ([fl]?)
(?:(?<=\.)|\b) (?!\.)
scope: constant.numeric.float.c
captures:
1: invalid.illegal.numeric-literal-character.float.whole-number.c
2: invalid.illegal.numeric-literal-character.float.fraction.c
3: invalid.illegal.numeric-literal-character.float.whole-number.c
4: keyword.other.exponent.decimal.c
5: invalid.illegal.numeric-literal-character.float.exponent.c
6: invalid.illegal.numeric-literal-character.float.exponent.c
7: invalid.illegal.numeric-literal-character.float.exponent.c
8: invalid.illegal.numeric-literal-character.float.exponent.c
9: storage.type.number.suffix.float.c
- match: |-
(?ix)
(?<!\.) \b
(0x)? 0++
(u?l{0,2}|lul?|llu)
\b (?!\.)
scope: constant.numeric.integer.zero.c
captures:
1: storage.type.number.prefix.hexadecimal.c
2: storage.type.number.suffix.c
- match: |-
(?ix)
(?<!\.) \b
(?: (0x) | (0b) )
(u?l{0,2}|lul?|llu)
\b (?!\.)
scope: invalid.illegal.invalid-number-literal.c
- match: |-
(?ix)
(?<!\.) \b
(0x) [0-9a-f]++
# any invalid chars
([0-9a-z]*?)
# the remainder (after invalid chars, if any) and a type
[0-9a-f]* (u?l{0,2}|lul?|llu)
\b (?!\.)
scope: constant.numeric.integer.hexadecimal.c
captures:
1: storage.type.number.prefix.hexadecimal.c
2: invalid.illegal.numeric-literal-character.integer.c
3: storage.type.number.suffix.c
- match: |-
(?ix)
(?<!\.) \b
(0b) [01]++
# any invalid chars
([0-9a-z]*?)
# the remainder (after invalid chars, if any) and a type
[01]* (u?l{0,2}|lul?|llu)
\b (?!\.)
scope: constant.numeric.integer.binary.c
captures:
1: storage.type.number.prefix.binary.c
2: invalid.illegal.numeric-literal-character.integer.c
3: storage.type.number.suffix.c
- match: |-
(?ix)
(?<!\.) \b
(0) [0-7]++
# any invalid chars
([0-9a-z]*?)
# the remainder (after invalid chars, if any) and a type
[0-7]* (u?l{0,2}|lul?|llu)
\b (?!\.)
scope: constant.numeric.integer.octal.c
captures:
1: storage.type.number.prefix.octal.c
2: invalid.illegal.numeric-literal-character.integer.c
3: storage.type.number.suffix.c
- match: |-
(?ix)
\b
[0-9][0-9_]*
# any invalid chars
([0-9a-z]*?)
# the remainder (after invalid chars, if any) and a type
[0-9]* (u?l{0,2}|lul?|llu)
\b
scope: constant.numeric.integer.decimal.c
captures:
1: invalid.illegal.numeric-literal-character.integer.c
2: storage.type.number.suffix.c
lex-string:
- match: '"'
captures:
0: punctuation.definition.string.begin.c
push:
- meta_scope: string.quoted.double.c
- match: '(")|(?<=^|[^\\])\s*(\n)'
captures:
1: punctuation.definition.string.end.c
2: invalid.illegal.unexpected-end-of-line.c
pop: true
- include: lex-continuation
- include: string_escaped_char
- include: string_placeholder
- match: "'"
captures:
0: punctuation.definition.string.begin.c
push:
- meta_scope: string.quoted.single.c
- match: '('')|(?<=^|[^\\])\s*(\n)'
captures:
1: punctuation.definition.string.end.c
2: invalid.illegal.unexpected-end-of-line.c
pop: true
- include: lex-continuation
- include: string_escaped_char
parens:
- match: (?=\()
push:
- match: \)
pop: true
- include: parens-lookahead-end
parens-lookahead-end:
- match: \(
push:
- meta_scope: meta.parens.c
- match: (?=\))
pop: true
- include: lex
- include: call
- include: support
- include: $top_level_main
ppline-any:
- match: ^\s*(#)
captures:
0: keyword.other.preprocessor.c
push:
- meta_scope: meta.preprocessor.directive.null-directive.c
- match: (?<=$\n)(?<!\\$\n)
pop: true
- include: lex-core
ppline-directive:
- match: ^\s*(#)\s*(if|elseif|else|endif|pragma|line|define|undef|section|assert|file|endinput|endscript)\b
captures:
0: keyword.other.preprocessor.c
push:
- meta_scope: meta.preprocessor.directive.c
- match: (?<=$\n)(?<!\\$\n)
pop: true
- include: lex-core
- include: lex-in-preprocessor
ppline-directive-emit:
- match: |-
(?x)
^\s*(\#|@)\s*(emit) #pre-processor directive
(\s+
([A-Z0-9a-z]+)
(
(\.)([A-Za-z]+)
((\.)([A-Za-z]+))?
)?
|\s*)
captures:
1: keyword.other.preprocessor.c
2: keyword.control.import.c
4: entity.name.function.preprocessor.c
6: punctuation.separator.parameters.c
7: entity.name.function.preprocessor.c
push:
- meta_scope: meta.preprocessor.directive.emit.c
- match: (?<=$\n)(?<!\\$\n)
pop: true
- include: lex-core
- include: lex-in-preprocessor
ppline-directive-invalid-usage:
- match: (^\s*(#)\s*(if|elseif|pragma|define|undef|include|tryinclude)\b)\s*?(\n|$)
scope: meta.preprocessor.directive.c
captures:
1: keyword.other.preprocessor.c
4: invalid.illegal.invalid-usage-of-preprocessor-directive.c
ppline-error:
- match: ^\s*(#)\s*(error|warning)\b
captures:
0: keyword.other.preprocessor.include.c
push:
- meta_scope: meta.preprocessor.include.c meta.preprocessor.c.include
- match: (.*)|(?<=$\n)(?<!\\$\n)
captures:
1: string.quoted.double.c
pop: true
ppline-include:
- match: ^\s*(#)\s*(include|tryinclude)\b
captures:
0: keyword.other.preprocessor.include.c
push:
- meta_scope: meta.preprocessor.include.c meta.preprocessor.c.include
- match: '(?:("[^"]*?)|(<[^>]*?))(\n)|(?<=$\n)(?<!\\$\n)'
captures:
1: string.quoted.double.include.c
2: string.quoted.other.lt-gt.include.c
3: invalid.illegal.unexpected-end-of-line.c
pop: true
- include: ppline-include-innards
ppline-include-innards:
- include: preprocessor-lex
- match: '"|(?=.*?")'
captures:
0: punctuation.definition.string.begin.c
push:
- meta_scope: string.quoted.double.include.c
- match: '"|(?<=^|[^\\])(?=\s*\n)'
captures:
0: punctuation.definition.string.end.c
pop: true
- match: <(?=.*?>)
captures:
0: punctuation.definition.string.begin.c
push:
- meta_scope: string.quoted.other.lt-gt.include.c
- match: '>|(?<=^|[^\\])(?=\s*\n)'
captures:
0: punctuation.definition.string.end.c
pop: true
- match: \(
push:
- meta_scope: meta.parens.c
- match: '\)|(?<=^|[^\\])(?=\s*\n)'
pop: true
- include: ppline-include-innards
ppline-invalid:
- match: '^\s*(#)(?!\s*(?=/[/*]|(?>\\\s*\n)|\n|$))\s*(\w*)'
captures:
1: keyword.other.preprocessor.c
2: invalid.illegal.preprocessor.c
push:
- meta_scope: meta.preprocessor.directive.illegal.c
- match: (?<=$\n)(?<!\\$\n)
pop: true
ppline-macro:
- match: '^\s*(#)(?=\s*(define)\s+[a-zA-Z_]\w*+)'
captures:
0: keyword.other.preprocessor.c
push:
- meta_scope: meta.preprocessor.macro.c
- match: (?<=$\n)(?<!\\$\n)
pop: true
- match: \s*(##)
captures:
1: keyword.other.preprocessor.c
- match: '\s*(#)\s*([a-zA-Z_]\w*+)'
captures:
1: keyword.other.preprocessor.c
2: string.macro.stringify.c
- include: ppline-macro-head-function
- include: ppline-macro-head-object
- include: ppline-macro-param
- include: lex-in-preprocessor
- include: support
ppline-macro-head-function:
- match: '(?<!##)(?<=#)(\s*define)\s+([a-zA-Z_]\w*+)(\()'
captures:
1: keyword.other.preprocessor.define.c
2: entity.name.function.preprocessor.c
3: meta.preprocessor.macro.parameters.c
push:
- meta_content_scope: meta.preprocessor.macro.parameters.c
- match: '(?<=\))|(?<=^|[^\\])\s*(\n)?'
captures:
1: invalid.illegal.unexpected-end-of-line.c
pop: true
- include: ppline-macro-param
ppline-macro-head-object:
- match: '(?<!##)(?<=#)(\s*define)\s+([a-zA-Z_]\w*+)(?!\()[\s&&[^\n]]*'
captures:
1: keyword.other.preprocessor.define.c
2: entity.name.constant.preprocessor.c
ppline-macro-param:
- match: '(%[0-9]+)'
captures:
1: variable.parameter.c
ppline-pragma-mark:
- match: '(^\s*(#)\s*(pragma\s+(align|amxlimit|amxram|codepage|compress|ctrlchar|deprecated|dynamic|library|overlay|pack|rational|semicolon|tabsize|unused))\b)[\s&&[^\n]]*'
captures:
1: keyword.other.preprocessor.pragma.c
push:
- meta_scope: meta.preprocessor.directive.c
- match: (?<=$\n)(?<!\\$\n)
pop: true
- include: lex-core
ppline-undef:
- match: '(^\s*(#)\s*(undef))\s+([a-zA-Z_]\w*+)'
captures:
1: keyword.other.preprocessor.c
4: variable.macro.undef.c
push:
- meta_scope: meta.preprocessor.undef.c
- match: (?<=$\n)(?<!\\$\n)
pop: true
preprocessor:
- match: (?=^\s*(#))
push:
- match: (?!^\s*(#))
pop: true
- include: ppline-directive-invalid-usage
- include: ppline-macro
- include: ppline-undef
- include: ppline-pragma-mark
- include: ppline-include
- include: ppline-error
- include: ppline-directive
- include: ppline-directive-emit
- include: ppline-invalid
- include: ppline-any
preprocessor-lex:
- include: comments
- include: lex-continuation
- include: lex-newline
string_escaped_char:
- match: '\\(\\|[abefnprtv''"?]|[0-3]\d{0,2}|[4-7]\d?|x[a-fA-F0-9]{0,2}|u[a-fA-F0-9]{0,4}|U[a-fA-F0-9]{0,8})'
scope: constant.character.escape.c
- match: \\.
scope: invalid.illegal.unknown-escape.c
string_placeholder:
- match: |-
(?x)%
(\d+\$)? # field (argument #)
[#0\- +']* # flags
[,;:_]? # separator character (AltiVec)
((-?\d+)|\*(-?\d+\$)?)? # minimum field width
(\.((-?\d+)|\*(-?\d+\$)?)?)? # precision
[diouxXDOUeEfFgGaACcSspnq%] # conversion type
scope: constant.other.placeholder.c
- match: '%'
scope: invalid.illegal.placeholder.c
support:
- include: support-modifier
- include: support-keyword
support-keyword:
- match: \s*\b(foreach)\b
captures:
1: keyword.control.c
support-modifier:
- match: \s*\b(inline|using)\b
captures:
1: storage.modifier.c
translation_unit:
- include: lex
- include: function
- include: support
- include: block
- include: parens
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment