summaryrefslogtreecommitdiff
path: root/keywords.py
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2022-07-22 14:54:07 -0400
committerpommicket <pommicket@gmail.com>2022-07-22 14:54:07 -0400
commit35b1b0129e8791a9412173acf3756606d0cc397d (patch)
tree6e631f6382cabf4ad2522bf4386828aaabae3347 /keywords.py
parent47a65f608f485af32d2df12be489146ad67839e1 (diff)
go syntax highlighting
also :goto-line now clamps numbers < 1 and > nlines instead of rejecting them
Diffstat (limited to 'keywords.py')
-rwxr-xr-xkeywords.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/keywords.py b/keywords.py
index b7f7432..1e345d9 100755
--- a/keywords.py
+++ b/keywords.py
@@ -300,6 +300,28 @@ constants_java = [
'true', 'false', 'null'
]
+keywords_go = [
+ 'break', 'default', 'func', 'interface', 'select',
+ 'case', 'defer', 'go', 'map', 'struct',
+ 'chan', 'else', 'goto', 'package', 'switch',
+ 'const', 'fallthrough', 'if', 'range', 'type',
+ 'continue', 'for', 'import', 'return', 'var'
+]
+
+constants_go = [
+ 'true', 'false', 'iota', 'nil'
+]
+
+builtins_go = [
+ 'new', 'make', 'cap', 'len', 'close', 'append', 'copy', 'delete',
+ 'complex', 'real', 'imag', 'panic', 'recover', 'print', 'println',
+ 'bool', 'uint8', 'uint16', 'uint32', 'uint64',
+ 'int8', 'int16', 'int32', 'int64',
+ 'float32', 'float64', 'complex64', 'complex128',
+ 'byte', 'rune', 'uint', 'int', 'uintptr', 'string', 'error',
+ 'comparable'
+]
+
file = open('keywords.h', 'w')
file.write('''// keywords for all languages ted supports
// This file was auto-generated by keywords.py
@@ -325,6 +347,8 @@ output_keywords(file, cpp_things, 'cpp')
output_keywords(file, label(keywords_rust, SYNTAX_KEYWORD) + label(builtins_rust, SYNTAX_BUILTIN) + label(constants_rust, SYNTAX_CONSTANT), 'rust')
output_keywords(file, label(keywords_javascript, SYNTAX_KEYWORD) + label(builtins_javascript, SYNTAX_BUILTIN) +
label(constants_javascript, SYNTAX_CONSTANT), 'javascript')
+output_keywords(file, label(keywords_go, SYNTAX_KEYWORD) + label(builtins_go, SYNTAX_BUILTIN) +
+ label(constants_go, SYNTAX_CONSTANT), 'go')
output_keywords(file, label(keywords_java, SYNTAX_KEYWORD) + label(constants_java, SYNTAX_CONSTANT), 'java')
output_keywords(file, label(keywords_python, SYNTAX_KEYWORD) + label(builtins_python, SYNTAX_BUILTIN), 'python')
output_keywords(file, label(builtins_html, SYNTAX_BUILTIN), 'html')