micro/runtime/syntax/arduino.micro

117 lines
3.6 KiB
Text
Raw Normal View History

2016-03-21 19:16:02 +03:00
## FILENAME: arduino.nanorc
##
## DESCRIPTION: The arduino.nanorc syntax files allows syntax highlighting
## for Arduino sketch files in the GNU nano text editor.
##
## Maintainer: Nicholas Wilde
## Version: 0.1
## DATE: 06/23/2011
##
## HOMEPAGE: http://code.google.com/p/arduino-nano-editor-syntax/
##
## COMMENTS: -Most of the code was taken from the c.nanorc code found with
## GNU nano 2.2.6.
## -Direction was taken from the arduino vim syntax code by johannes
## <https://bitbucket.org/johannes/arduino-vim-syntax/>
## -Tested on Ubuntu Server 11.04 Natty Narwhal and GNU nano 2.2.6
##
## DIRECTIONS: For Ubuntu Server 11.04 Natty Narwhal:
## -Move this file <arduino.nanorc> to the nano directory
## /usr/share/nano/
## -Add arduino.nanorc reference to the nanorc settings file
## /etc/nanorc
## ...
## ## Arduino
## /usr/share/nano/arduino.nanorc
## ...
syntax "ino" "\.?ino$"
2016-03-21 19:16:02 +03:00
##
color identifier.macro "\b[A-Z_][0-9A-Z_]+\b"
2016-03-21 19:16:02 +03:00
##
color type "\b((s?size)|((u_?)?int(8|16|32|64|ptr)))_t\b"
2016-03-21 19:16:02 +03:00
## Constants
color constant "\b(HIGH|LOW|INPUT|OUTPUT)\b"
2016-03-21 19:16:02 +03:00
## Serial Print
color identifier.macro "\b(DEC|BIN|HEX|OCT|BYTE)\b"
2016-03-21 19:16:02 +03:00
## PI Constants
color constant "\b(PI|HALF_PI|TWO_PI)\b"
2016-03-21 19:16:02 +03:00
## ShiftOut
color constant "\b(LSBFIRST|MSBFIRST)\b"
2016-03-21 19:16:02 +03:00
## Attach Interrupt
color constant "\b(CHANGE|FALLING|RISING)\b"
2016-03-21 19:16:02 +03:00
## Analog Reference
color constant "\b(DEFAULT|EXTERNAL|INTERNAL|INTERNAL1V1|INTERNAL2V56)\b"
2016-03-21 19:16:02 +03:00
## === FUNCTIONS === ##
## Data Types
color type "\b(boolean|byte|char|float|int|long|word)\b"
2016-03-21 19:16:02 +03:00
## Control Structions
color 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"
color special "\b(goto|continue|break|return)\b"
2016-03-21 19:16:02 +03:00
## Math
color 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"
2016-03-21 19:16:02 +03:00
## Bits & Bytes
color statement "\b(bitRead|bitWrite|bitSet|bitClear|bit|highByte|lowByte)\b"
2016-03-21 19:16:02 +03:00
## Analog I/O
color statement "\b(analogReference|analogRead|analogWrite)\b"
2016-03-21 19:16:02 +03:00
## External Interrupts
color statement "\b(attachInterrupt|detachInterrupt)\b"
2016-03-21 19:16:02 +03:00
## Time
color statement "\b(delay|delayMicroseconds|millis|micros)\b"
2016-03-21 19:16:02 +03:00
## Digital I/O
color statement "\b(pinMode|digitalWrite|digitalRead)\b"
2016-03-21 19:16:02 +03:00
## Interrupts
color statement "\b(interrupts|noInterrupts)\b"
2016-03-21 19:16:02 +03:00
## Advanced I/O
color statement "\b(noTone|pulseIn|shiftIn|shiftOut|tone)\b"
2016-03-21 19:16:02 +03:00
## Serial
color special "b<(Serial|Serial1|Serial2|Serial3|begin|end|peek|read|print|println|available|flush)\b"
2016-03-21 19:16:02 +03:00
## Structure
color statement "\b(setup|loop)\b"
2016-03-21 19:16:02 +03:00
##
color preproc "^[[:space:]]*#[[:space:]]*(define|include(_next)?|(un|ifn?)def|endif|el(if|se)|if|warning|error|pragma)"
2016-03-21 19:16:02 +03:00
##
color constant.specialChar "'([^']|(\\["'abfnrtv\\]))'" "'\\(([0-3]?[0-7]{1,2}))'" "'\\x[0-9A-Fa-f]{1,2}'"
2016-03-21 19:16:02 +03:00
## GCC builtins
color preproc "__attribute__[[:space:]]*\(\([^)]*\)\)" "__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__"
2016-03-21 19:16:02 +03:00
2016-03-25 23:41:36 +03:00
## String highlighting. You will in general want your comments and
2016-03-21 19:16:02 +03:00
## strings to come last, because syntax highlighting rules will be
## applied in the order they are read in.
color constant.string "<[^= ]*>" ""(\\.|[^"])*""
2016-03-21 19:16:02 +03:00
## This string is VERY resource intensive!
color constant.string start=""(\\.|[^"])*\\[[:space:]]*$" end="^(\\.|[^"])*""
2016-03-21 19:16:02 +03:00
## Comments
color comment "//.*"
color comment start="/\*" end="\*/"
2016-03-21 19:16:02 +03:00
## Trailing whitespace
color indent-char.whitespace "[[:space:]]+$"