Hare homepage: https://harelang.org --- The language is still evolving a bit, and I may have missed a few edge cases, but this definition should be a pretty good start. You can find renderings of two example files from the standard library and one example from the tutorial here:
* https://bitfehler.net/database.html * https://bitfehler.net/lookup.html * https://bitfehler.net/num.html src/hare.lang | 34 ++++++++++++++++++++++++++++++++++ src/lang.map | 2 ++ tests/lang.list | 2 ++ 3 files changed, 38 insertions(+) create mode 100644 src/hare.lang diff --git a/src/hare.lang b/src/hare.lang new file mode 100644 index 0000000..ad9f7f4 --- /dev/null +++ b/src/hare.lang @@ -0,0 +1,34 @@ +# definitions for Hare + +include "c_comment.lang" + +label = "@fini|@init|@noreturn|@test" + +(keyword,normal,usertype) = + `(\<(?:type))([[:blank:]]+)([[:alnum:]_]+)` + +preproc = '^use[[:blank:]]+([[:word:]]+)(::[[:word:]{}]*)*;' + +number = +'\<[+-]?((0x[[:xdigit:]]+)|(0o[0-7]+)|(0b[01]+)|(([[:digit:]]*\.)? +[[:digit:]]+([eE][+-]?[[:digit:]]+)?))(f32|f64)?(([iu](8|16|32|64)?)|z)?\>' +number = "false|null|true" + +include "c_string.lang" + +keyword = "abort|alloc|append|as|assert", + "break|case|const|continue", + "def|defer|delete|else|export|for|free", + "if|is|len|let|match|offset", + "return|static|switch|type|use|yield|_" + +type = "bool|char|double|enum|f32|f64|fn", + "i16|i32|i64|i8|int|nullable|rune|size|str", + "struct|u16|u32|u64|u8|uint|uintptr|union|void" + +symbol = "~","%","^","*","(",")","-","+","=","[", + "]","\\",":",";",",",".","/","&","<",">","\|" + +cbracket = "{|}|!|?" + +include "function.lang" diff --git a/src/lang.map b/src/lang.map index a428eb6..e748a8b 100644 --- a/src/lang.map +++ b/src/lang.map @@ -11,6 +11,8 @@ cs = csharp.lang csharp = csharp.lang go = go.lang h = cpp.lang +ha = hare.lang +hare = hare.lang hh = cpp.lang H = cpp.lang hpp = cpp.lang diff --git a/tests/lang.list b/tests/lang.list index cd120f9..4f61e7d 100644 --- a/tests/lang.list +++ b/tests/lang.list @@ -56,6 +56,8 @@ glsl = glsl.lang go = go.lang groovy = groovy.lang h = cpp.lang +ha = hare.lang +hare = hare.lang haskell = haskell.lang haxe = haxe.lang hh = cpp.lang -- 2.36.1 _______________________________________________ Help-source-highlight mailing list [email protected] https://lists.gnu.org/mailman/listinfo/help-source-highlight
