]> git.lizzy.rs Git - micro.git/blob - runtime/syntax/arduino.yaml
e0a38dc227246260779674d862bc3f01d3292c4c
[micro.git] / runtime / syntax / arduino.yaml
1 filetype: ino
2
3 detect: 
4     filename: "\\.?ino$"
5
6 rules:
7     - identifier.macro: "\\b[A-Z_][0-9A-Z_]+\\b"
8     - type: "\\b((s?size)|((u_?)?int(8|16|32|64|ptr)))_t\\b"
9     - constant: "\\b(HIGH|LOW|INPUT|OUTPUT)\\b"
10     - identifier.macro: "\\b(DEC|BIN|HEX|OCT|BYTE)\\b"
11     - constant: "\\b(PI|HALF_PI|TWO_PI)\\b"
12     - constant: "\\b(LSBFIRST|MSBFIRST)\\b"
13     - constant: "\\b(CHANGE|FALLING|RISING)\\b"
14     - constant: "\\b(DEFAULT|EXTERNAL|INTERNAL|INTERNAL1V1|INTERNAL2V56)\\b"
15     - type: "\\b(boolean|byte|char|float|int|long|word)\\b"
16     - statement: "\\b(case|class|default|do|double|else|false|for|if|new|null|private|protected|public|short|signed|static|String|switch|this|throw|try|true|unsigned|void|while)\\b"
17     - special: "\\b(goto|continue|break|return)\\b"
18     - statement: "\\b(abs|acos|asin|atan|atan2|ceil|constrain|cos|degrees|exp|floor|log|map|max|min|radians|random|randomSeed|round|sin|sq|sqrt|tan)\\b"
19     - statement: "\\b(bitRead|bitWrite|bitSet|bitClear|bit|highByte|lowByte)\\b"
20     - statement: "\\b(analogReference|analogRead|analogWrite)\\b"
21     - statement: "\\b(attachInterrupt|detachInterrupt)\\b"
22     - statement: "\\b(delay|delayMicroseconds|millis|micros)\\b"
23     - statement: "\\b(pinMode|digitalWrite|digitalRead)\\b"
24     - statement: "\\b(interrupts|noInterrupts)\\b"
25     - statement: "\\b(noTone|pulseIn|shiftIn|shiftOut|tone)\\b"
26     - special: "\\b(Serial|Serial1|Serial2|Serial3|begin|end|peek|read|print|println|available|flush)\\b"
27     - statement: "\\b(setup|loop)\\b"
28     - preproc: "^[[:space:]]*#[[:space:]]*(define|include(_next)?|(un|ifn?)def|endif|el(if|se)|if|warning|error|pragma)"
29     - constant.specialChar: "'([^']|(\\\\[\"'abfnrtv\\\\]))'|'\\\\(([0-3]?[0-7]{1,2}))'|'\\\\x[0-9A-Fa-f]{1,2}'"
30     - preproc: "__attribute__[[:space:]]*\\(\\([^)]*\\)\\)|__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__"
31     - constant.string: "<[^=    ]*>|\"(\\\\.|[^\"])*\""
32     - constant.string:
33         start: "\"(\\\\.|[^\"])*\\\\[[:space:]]*$"
34         end: "^(\\\\.|[^\"])*\""
35         rules: []
36
37     - comment: "//.*"
38     - comment:
39         start: "/\\*"
40         end: "\\*/"
41         rules: []
42
43     - indent-char.whitespace: "[[:space:]]+$"