]> git.lizzy.rs Git - micro.git/blob - syntax_files/arduino.micro
Proper window resize handling
[micro.git] / syntax_files / arduino.micro
1
2 ## FILENAME:    arduino.nanorc
3 ##
4 ## DESCRIPTION: The arduino.nanorc syntax files allows syntax highlighting
5 ##              for Arduino sketch files in the GNU nano text editor.
6 ##
7 ## Maintainer:  Nicholas Wilde
8 ## Version:     0.1
9 ## DATE:        06/23/2011
10 ##
11 ## HOMEPAGE:    http://code.google.com/p/arduino-nano-editor-syntax/
12 ##
13 ## COMMENTS:    -Most of the code was taken from the c.nanorc code found with 
14 ##               GNU nano 2.2.6.
15 ##              -Direction was taken from the arduino vim syntax code by johannes
16 ##               <https://bitbucket.org/johannes/arduino-vim-syntax/>
17 ##              -Tested on Ubuntu Server 11.04 Natty Narwhal and GNU nano 2.2.6
18 ##
19 ## DIRECTIONS:  For Ubuntu Server 11.04 Natty Narwhal:
20 ##              -Move this file <arduino.nanorc> to the nano directory
21 ##               /usr/share/nano/
22 ##              -Add arduino.nanorc reference to the nanorc settings file
23 ##               /etc/nanorc
24 ##               ...
25 ##               ## Arduino
26 ##               /usr/share/nano/arduino.nanorc
27 ##               ...
28
29 syntax "INO"  "\.?ino$"
30
31 ## 
32 color brightred "\b[A-Z_][0-9A-Z_]+\b" 
33
34 ## 
35 color green "\b((s?size)|((u_?)?int(8|16|32|64|ptr)))_t\b"
36
37 ## Constants
38 color green (i) "\b(HIGH|LOW|INPUT|OUTPUT)\b"
39
40 ## Serial Print
41 color red (i) "\b(DEC|BIN|HEX|OCT|BYTE)\b"
42
43 ## PI Constants
44 color green (i) "\b(PI|HALF_PI|TWO_PI)\b"
45
46 ## ShiftOut
47 color green (i) "\b(LSBFIRST|MSBFIRST)\b"
48
49 ## Attach Interrupt
50 color green (i) "\b(CHANGE|FALLING|RISING)\b"
51
52 ## Analog Reference
53 color green (i) "\b(DEFAULT|EXTERNAL|INTERNAL|INTERNAL1V1|INTERNAL2V56)\b"
54
55 ## === FUNCTIONS === ##
56
57 ## Data Types
58 color green "\b(boolean|byte|char|float|int|long|word)\b"
59
60 ## Control Structions
61 color brightyellow "\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" 
62 color magenta "\b(goto|continue|break|return)\b"
63
64 ## Math
65 color brightyellow "\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"
66
67 ## Bits & Bytes
68 color brightyellow "\b(bitRead|bitWrite|bitSet|bitClear|bit|highByte|lowByte)\b"
69
70 ## Analog I/O
71 color brightyellow "\b(analogReference|analogRead|analogWrite)\b"
72
73 ## External Interrupts
74 color brightyellow "\b(attachInterrupt|detachInterrupt)\b"
75
76 ## Time
77 color brightyellow "\b(delay|delayMicroseconds|millis|micros)\b"
78
79 ## Digital I/O
80 color brightyellow "\b(pinMode|digitalWrite|digitalRead)\b"
81
82 ## Interrupts
83 color brightyellow "\b(interrupts|noInterrupts)\b"
84
85 ## Advanced I/O
86 color brightyellow "\b(noTone|pulseIn|shiftIn|shiftOut|tone)\b"
87
88 ## Serial
89 color magenta "\b(Serial|Serial1|Serial2|Serial3|begin|end|peek|read|print|println|available|flush)\b"
90
91 ## Structure
92 color brightyellow "\b(setup|loop)\b"
93
94 ## 
95 color brightcyan "^[[:space:]]*#[[:space:]]*(define|include(_next)?|(un|ifn?)def|endif|el(if|se)|if|warning|error|pragma)"
96
97 ## 
98 color brightmagenta "'([^'\]|(\\["'abfnrtv\\]))'" "'\\(([0-3]?[0-7]{1,2}))'" "'\\x[0-9A-Fa-f]{1,2}'"
99
100 ## GCC builtins
101 color cyan "__attribute__[[:space:]]*\(\([^)]*\)\)" "__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__"
102
103 ## String highlighting.  You will in general want your brightblacks and
104 ## strings to come last, because syntax highlighting rules will be
105 ## applied in the order they are read in.
106 color brightyellow "<[^=    ]*>" ""(\\.|[^"])*""
107
108 ## This string is VERY resource intensive!
109 color brightyellow (s) ""(\\.|[^"])*\\[[:space:]]*$.*?^(\\.|[^"])*""
110
111 ## Comments
112 color brightblue "//.*"
113 color brightblue (s) "/\*.*?\*/"
114
115 ## Trailing whitespace
116 color ,green "[[:space:]]+$"