nanorc/arduino.nanorc

117 lines
3.5 KiB
Plaintext
Raw Normal View History

2015-12-15 02:54:49 +01: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$"
2015-12-15 02:54:49 +01:00
##
2018-08-09 10:09:19 +02:00
color red "\<[A-Z_][0-9A-Z_]+\>"
2015-12-15 02:54:49 +01:00
##
color green "\<((s?size)|((u_?)?int(8|16|32|64|ptr)))_t\>"
## Constants
icolor green "\<(HIGH|LOW|INPUT|OUTPUT)\>"
## Serial Print
icolor red "\<(DEC|BIN|HEX|OCT|BYTE)\>"
## PI Constants
icolor green "\<(PI|HALF_PI|TWO_PI)\>"
## ShiftOut
icolor green "\<(LSBFIRST|MSBFIRST)\>"
## Attach Interrupt
icolor green "\<(CHANGE|FALLING|RISING)\>"
## Analog Reference
icolor green "\<(DEFAULT|EXTERNAL|INTERNAL|INTERNAL1V1|INTERNAL2V56)\>"
## === FUNCTIONS === ##
## Data Types
color green "\<(boolean|byte|char|float|int|long|word)\>"
## Control Structions
2018-08-09 10:09:19 +02:00
color yellow "\<(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)\>"
2015-12-15 02:54:49 +01:00
color magenta "\<(goto|continue|break|return)\>"
## Math
2018-08-09 10:09:19 +02:00
color yellow "\<(abs|acos|asin|atan|atan2|ceil|constrain|cos|degrees|exp|floor|log|map|max|min|radians|random|randomSeed|round|sin|sq|sqrt|tan)\>"
2015-12-15 02:54:49 +01:00
## Bits & Bytes
2018-08-09 10:09:19 +02:00
color yellow "\<(bitRead|bitWrite|bitSet|bitClear|bit|highByte|lowByte)\>"
2015-12-15 02:54:49 +01:00
## Analog I/O
2018-08-09 10:09:19 +02:00
color yellow "\<(analogReference|analogRead|analogWrite)\>"
2015-12-15 02:54:49 +01:00
## External Interrupts
2018-08-09 10:09:19 +02:00
color yellow "\<(attachInterrupt|detachInterrupt)\>"
2015-12-15 02:54:49 +01:00
## Time
2018-08-09 10:09:19 +02:00
color yellow "\<(delay|delayMicroseconds|millis|micros)\>"
2015-12-15 02:54:49 +01:00
## Digital I/O
2018-08-09 10:09:19 +02:00
color yellow "\<(pinMode|digitalWrite|digitalRead)\>"
2015-12-15 02:54:49 +01:00
## Interrupts
2018-08-09 10:09:19 +02:00
color yellow "\<(interrupts|noInterrupts)\>"
2015-12-15 02:54:49 +01:00
## Advanced I/O
2018-08-09 10:09:19 +02:00
color yellow "\<(noTone|pulseIn|shiftIn|shiftOut|tone)\>"
2015-12-15 02:54:49 +01:00
## Serial
color magenta "\<(Serial|Serial1|Serial2|Serial3|begin|end|peek|read|print|println|available|flush)\>"
## Structure
2018-08-09 10:09:19 +02:00
color yellow "\<(setup|loop)\>"
2015-12-15 02:54:49 +01:00
##
2018-08-09 10:09:19 +02:00
color cyan "^[[:space:]]*#[[:space:]]*(define|include(_next)?|(un|ifn?)def|endif|el(if|se)|if|warning|error|pragma)"
2015-12-15 02:54:49 +01:00
##
2018-08-09 10:09:19 +02:00
color magenta "'([^'\]|(\\["'abfnrtv\\]))'" "'\\(([0-3]?[0-7]{1,2}))'" "'\\x[0-9A-Fa-f]{1,2}'"
2015-12-15 02:54:49 +01:00
## GCC builtins
color cyan "__attribute__[[:space:]]*\(\([^)]*\)\)" "__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__"
## String highlighting. You will in general want your comments and
## strings to come last, because syntax highlighting rules will be
## applied in the order they are read in.
2018-08-09 10:09:19 +02:00
color yellow "<[^= ]*>" ""(\\.|[^"])*""
2015-12-15 02:54:49 +01:00
## This string is VERY resource intensive!
2018-08-09 10:09:19 +02:00
color yellow start=""(\\.|[^"])*\\[[:space:]]*$" end="^(\\.|[^"])*""
2015-12-15 02:54:49 +01:00
## Comments
2018-08-09 10:09:19 +02:00
color blue "//.*"
color blue start="/\*" end="\*/"
2015-12-15 02:54:49 +01:00
## Trailing whitespace
color ,green "[[:space:]]+$"