From 073ea1caa54fe0677aea04d7426d6e810256389d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Charri=C3=A8re?= Date: Sat, 30 Jul 2016 18:38:55 +0200 Subject: [PATCH 1/2] Add Gololang support --- runtime/syntax/golo.micro | 48 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 runtime/syntax/golo.micro diff --git a/runtime/syntax/golo.micro b/runtime/syntax/golo.micro new file mode 100644 index 00000000..ec4bf80e --- /dev/null +++ b/runtime/syntax/golo.micro @@ -0,0 +1,48 @@ +syntax "Golo" "\.golo$" + +color orange "\b(function|fun|)\b" +color type "\b(struct|DynamicObject|union|AdapterFabric|Adapter|DynamicVariable|Observable)\b" +color type "\b(list|set|array|vector|tuple|map)\b" +color type "\b(Ok|Error|Empty|None|Some|Option|Result|Result.ok|Result.fail|Result.error|Result.empty|Optional.empty|Optional.of)\b" + +color statement "\b(augment|pimp)\b" +color statement "\b(interfaces|implements|extends|overrides|maker|newInstance)\b" +color statement "\b(isEmpty|isNone|isPresent|isSome|iterator|flattened|toList|flatMap|`and|orElseGet|`or|toResult|apply|either)\b" +color statement "\b(result|option|trying|raising|nullify|catching)\b" +color statement "\b(promise|setFuture|failedFuture|all|any)\b" +color statement "\b(initialize|initializeWithinThread|start|future|fallbackTo|onSet|onFail|cancel|enqueue)\b" +color statement "\b(println|print|raise|readln|readPassword|secureReadPassword|requireNotNull|require|newTypedArray|range|reversedRange|mapEntry|asInterfaceInstance|asFunctionalInterface|isClosure|fileToText|textToFile|fileExists|currentDir|sleep|uuid|isArray|arrayTypeOf|charValue|intValue|longValue|doubleValue|floatValue|removeByIndex|box)\b" +color statement "\b(likelySupported|reset|bold|underscore|blink|reverse_video|concealed|fg_black|fg_red|fg_green|fg_yellow|fg_blue|fg_magenta|fg_cyan|fg_white|bg_black|bg_red|bg_green|bg_yellow|bg_blue|bg_magenta|bg_cyan|bg_white|cursor_position|cursor_save_position|cursor_restore_position|cursor_up|cursor_down|cursor_forward|cursor_backward|erase_display|erase_line)\b" +color statement "\b(emptyList|cons|lazyList|fromIter|generator|repeat|iterate)\b" +color statement "\b(asLazyList|foldl|foldr|take|takeWhile|drop|dropWhile|subList)\b" +color statement "\b(import)\b" +color statement "\b(module)\b" +color statement "\b(JSON)\b" +color statement "\b(stringify|parse|toJSON|toDynamicObject|updateFromJSON)\b" +color statement "\b(newInstance|define|getKey|getValue|properties|fallback)\b" +color statement "\b(times|upTo|downTo)\b" +color statement "\b(format|toInt|toInteger|toDouble|toFloat|toLong)\b" +color statement "\b(head|tail|isEmpty|reduce|each|count|exists)\b" +color statement "\b(newWithSameType|destruct|append|add|addIfAbsent|prepend|insert|last|unmodifiableView|find|filter|map|join|reverse|reversed|order|ordered|removeAt|include|exclude|remove|delete|has|contains|getOrElse|toArray)\b" +color statement "\b(add|addTo|succ|pred|mul|neg|sub|rsub|div|rdiv|mod|rmod|pow|rpow|str|lt|gt|eq|ne|ge|le|`and|`or|`not|xor|even|odd|contains|isEmpty|`is|`isnt|`oftype|`orIfNull|fst|snd|getitem|setitem|getter|id|const|False|True|Null|curry|uncurry|unary|spreader|varargs|swapArgs|swapCurry|swapCouple|swap|invokeWith|pipe|compose|io|andThen|until|recur|cond)\b" +color statement "\b(toUpperCase|equals|startsWith)\b" + +color blue "\b(if|else|then|when|case|match|otherwise)\b" +color brightblue "\b(with|break|continue|return)\b" +color green "\b(try|catch|finally|throw)\b" +color brightgreen "\b(super|this|let|var|local)\b" +color brightred "[(){}]" "\[" "\]" +color yellow "\b(for|while|foreach|in)\b" +color orange "\b(and|in|is|not|or|isnt|orIfNull)\b" + +color constant "\b(true|false)\b" +color constant "\b(null|undefined)\b" + +color statement "[-+/*=<>!~%&|^]|:=" +color constant.number "\b([0-9]+|0x[0-9a-fA-F]*)\b|'.'" +color constant.string ""(\\.|[^"])*"|'(\\.|[^'])*'" + +color comment "#.*$" +color comment start="----" end="----" + +color todo "TODO:?" From ad3031c95ccb3b6f2050c351eff4606dd55a394e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Charri=C3=A8re?= Date: Sat, 30 Jul 2016 20:20:28 +0200 Subject: [PATCH 2/2] To only use the colorscheme groups --- runtime/syntax/golo.micro | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/runtime/syntax/golo.micro b/runtime/syntax/golo.micro index ec4bf80e..f3a9529b 100644 --- a/runtime/syntax/golo.micro +++ b/runtime/syntax/golo.micro @@ -1,6 +1,6 @@ syntax "Golo" "\.golo$" -color orange "\b(function|fun|)\b" +color type "\b(function|fun|)\b" color type "\b(struct|DynamicObject|union|AdapterFabric|Adapter|DynamicVariable|Observable)\b" color type "\b(list|set|array|vector|tuple|map)\b" color type "\b(Ok|Error|Empty|None|Some|Option|Result|Result.ok|Result.fail|Result.error|Result.empty|Optional.empty|Optional.of)\b" @@ -27,13 +27,13 @@ color statement "\b(newWithSameType|destruct|append|add|addIfAbsent|prepend|inse color statement "\b(add|addTo|succ|pred|mul|neg|sub|rsub|div|rdiv|mod|rmod|pow|rpow|str|lt|gt|eq|ne|ge|le|`and|`or|`not|xor|even|odd|contains|isEmpty|`is|`isnt|`oftype|`orIfNull|fst|snd|getitem|setitem|getter|id|const|False|True|Null|curry|uncurry|unary|spreader|varargs|swapArgs|swapCurry|swapCouple|swap|invokeWith|pipe|compose|io|andThen|until|recur|cond)\b" color statement "\b(toUpperCase|equals|startsWith)\b" -color blue "\b(if|else|then|when|case|match|otherwise)\b" -color brightblue "\b(with|break|continue|return)\b" -color green "\b(try|catch|finally|throw)\b" -color brightgreen "\b(super|this|let|var|local)\b" -color brightred "[(){}]" "\[" "\]" -color yellow "\b(for|while|foreach|in)\b" -color orange "\b(and|in|is|not|or|isnt|orIfNull)\b" +color preproc "\b(if|else|then|when|case|match|otherwise)\b" +color preproc "\b(with|break|continue|return)\b" +color error "\b(try|catch|finally|throw)\b" +color identifier "\b(super|this|let|var|local)\b" +color special "[(){}]" "\[" "\]" +color preproc "\b(for|while|foreach|in)\b" +color constant "\b(and|in|is|not|or|isnt|orIfNull)\b" color constant "\b(true|false)\b" color constant "\b(null|undefined)\b"