| 1 |
filetype: nim |
| 2 |
|
| 3 |
detect: |
| 4 |
filename: "\\.nims?$|nim.cfg" |
| 5 |
|
| 6 |
rules: |
| 7 |
- preproc: "[\\{\\|]\\b(atom|lit|sym|ident|call|lvalue|sideeffect|nosideeffect|param|genericparam|module|type|let|var|const|result|proc|method|iterator|converter|macro|template|field|enumfield|forvar|label|nk[a-zA-Z]+|alias|noalias)\\b[\\}\\|]" |
| 8 |
- statement: "\\b(addr|and|as|asm|atomic|bind|block|break|case|cast|concept|const|continue|converter|defer|discard|distinct|div|do|elif|else|end|enum|except|export|finally|for|from|func|generic|if|import|in|include|interface|is|isnot|iterator|let|macro|method|mixin|mod|nil|not|notin|object|of|or|out|proc|ptr|raise|ref|return|shl|shr|static|template|try|tuple|type|using|var|when|while|with|without|xor|yield)\\b" |
| 9 |
- statement: "\\b(deprecated|noSideEffect|constructor|destructor|override|procvar|compileTime|noReturn|acyclic|final|shallow|pure|asmNoStackFrame|error|fatal|warning|hint|line|linearScanEnd|computedGoto|unroll|immediate|checks|boundsChecks|overflowChecks|nilChecks|assertations|warnings|hints|optimization|patterns|callconv|push|pop|global|pragma|experimental|bitsize|volatile|noDecl|header|incompleteStruct|compile|link|passC|passL|emit|importc|importcpp|importobjc|codegenDecl|injectStmt|intdefine|strdefine|varargs|exportc|extern|bycopy|byref|union|packed|unchecked|dynlib|cdecl|thread|gcsafe|threadvar|guard|locks|compileTime)\\b" |
| 10 |
- symbol.operator: "[=\\+\\-\\*/<>@\\$~&%\\|!\\?\\^\\.:\\\\]+" |
| 11 |
- special: "\\{\\.|\\.\\}|\\[\\.|\\.\\]|\\(\\.|\\.\\)|;|,|`" |
| 12 |
- statement: "\\.\\." |
| 13 |
- type: "\\b(int|cint|int8|int16|int32|int64|uint|uint8|uint16|uint32|uint64|float|float32|float64|bool|char|enum|string|cstring|cstringArray|cdouble|csize_t|pointer|array|openarray|seq|varargs|tuple|object|set|void|auto|cshort|clong|range|nil|T|untyped|typedesc)\\b" |
| 14 |
- type: "'[iI](8|16|32|64)?\\b|'[uU](8|16|32|64)?\\b|'[fF](32|64|128)?\\b|'[dD]\\b" |
| 15 |
- constant.number: "\\b[0-9]+\\b" |
| 16 |
- constant.number: "\\b0[xX][0-9A-Fa-f][0-9_A-Fa-f]+\\b" |
| 17 |
- constant.number: "\\b0[ocC][0-7][0-7_]+\\b" |
| 18 |
- constant.number: "\\b0[bB][01][01_]+\\b" |
| 19 |
- constant.number: "\\b[0-9_]((\\.?)[0-9_]+)?[eE][+\\-][0-9][0-9_]+\\b" |
| 20 |
- constant.string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'" |
| 21 |
- comment: "[[:space:]]*(?:[^\\\\]|^)#.*$" |
| 22 |
- comment: |
| 23 |
start: "\\#\\[" |
| 24 |
end: "\\]\\#" |
| 25 |
rules: [] |
| 26 |
|
| 27 |
- todo: "(TODO|FIXME|XXX):?" |