From 612ebb2e179e783e2a1e1a047e5d9361da2c261f Mon Sep 17 00:00:00 2001 From: Ender - Josh Pritsker Date: Sat, 25 May 2019 21:01:24 -0700 Subject: [PATCH] Add Forth highlighting --- runtime/syntax/forth.yaml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 runtime/syntax/forth.yaml diff --git a/runtime/syntax/forth.yaml b/runtime/syntax/forth.yaml new file mode 100644 index 00000000..62931f1a --- /dev/null +++ b/runtime/syntax/forth.yaml @@ -0,0 +1,34 @@ +filetype: forth + +detect: + filename: "\\.(forth|4th|fs|fs8|ft|fth|frt)$" + +rules: + - identifier: "\\b[A-Za-z_0-9-]*\\b" + + - statement: "\\b(?i:(if|else|then|do|loop|case|endcase|of|endof|begin|while|repeat|until|again|unloop|leave|exit|done|next|\\?do|\\+do|\\-do|\\+loop|\\-loop|\\?leave))\\b" + + - statement: "(^:|;$)" + + - type: "\\b(?i:(variable|constant|cells))\\b" + + - special: "\\B[?.]\\B" #for some reason, \b and \B are inverted for symbols + + - constant.number: "\\b[0-9]+\\b" + + - constant.string: + start: "\\b([Ss.]\" )" + end: "\"" + rules: [] + + - comment: + start: "\\(" + end: "\\)" + rules: + - todo: "(TODO|NOTE|XXX|FIXME):?" + + - comment: + start: "\\\\" + end: "$" + rules: + - todo: "(TODO|NOTE|XXX|FIXME):?"