From b0cfb2e69196e770a86cf8b9cea84752f9ce7c08 Mon Sep 17 00:00:00 2001 From: tommy Date: Wed, 27 Dec 2017 14:27:42 +0000 Subject: [PATCH] #964 add ada syntax --- runtime/syntax/ada.yaml | 44 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 runtime/syntax/ada.yaml diff --git a/runtime/syntax/ada.yaml b/runtime/syntax/ada.yaml new file mode 100644 index 00000000..7b59f27d --- /dev/null +++ b/runtime/syntax/ada.yaml @@ -0,0 +1,44 @@ +filetype: ada + +detect: + filename: "(\\.ads$|\\.adb$|\\.ada$)" + +rules: + # Operators + - symbol.operator: ([.:;,+*|=!?\\%]|<|>|/|-|&) + - symbol.brackets: "[(){}]|\\[|\\]" + # keyword.reserved + - statement.reserved: \b(abort|abs|abstract|accept|access|aliased|all|and|array|at|begin|body|case)\b + - statement.reserved: \b(constant|declare|delay|delta|digits|do|else|elsif|end|entry|exception|exit|for|function)\b + - statement.reserved: \b(generic|goto|if|in|interface|is|limited|loop|mod|new|not|null|of|or|others|out|overriding)\b + - statement.reserved: \b(package|pragma|private|procedure|protected|raise|range|record|rem|renames|return|requeue)\b + - statement.reserved: \b(reverse|select|separate|some|subtype|synchronized|tagged|task|terminate|then|type|until)\b + - statement.reserved: \b(use|when|while|with|xor)\b + + # Constant + - constant.bool: \b(TRUE|FALSE) + - constant.number: ([0-9]+) + + # Storage Types + - type.storage: \b(INTEGER|NATURAL|POSITIVE|FLOAT|CHARACTER|STRING)\b + - type.storage: \b(LONG_INTEGER|SHORT_INTEGER|LONG_FLOAT|SHORT_FLOAT)\b + + #Character + - constant.string.char: \'.\' + + # String + - constant.string: + start: \" + end: \" + skip: \\. + rules: + - constant.specialChar: (\\0|\\\\|\\t|\\n|\\r|\\"|\\') + - constant.interpolation: \\\([[:graph:]]*\) + - constant.unicode: \\u\{[[:xdigit:]]+} + + + # Line Comment + - comment.line: "--.*" + + # Todo + - todo: "(TODO|XXX|FIXME):?"