# GNU source-highlight syntax definitions for SLUL # # Copyright © 2023-2024 Samuel Lidén Borell # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. environment preproc start '^\\[[:alnum:]]+' begin include "url.lang" end environment comment delim '^#\{\{' '^#\}\}.*$' multiline nested begin include "url.lang" include "todo.lang" end environment comment start "#" begin include "url.lang" include "todo.lang" end label = '^[[:blank:]]*[[:alnum:]]+:[[:blank:]]*\z' number = '\<[[:digit:]]+(\.[[:digit:]]+)?([eE][+-]?[[:digit:]]+)?|0x[[:xdigit:]]+|0b[01]+\>' include "c_string.lang" keyword = "func|type|data", "assert|if|else|for|in|while|do|switch", "case|default|subcase|loopend|loopempty", "break|continue|goto|return", "and|bitand|bitor|bitnot|bitxor|deref|not|or|ref_is|ref_is_not|refto|shl|shr", "lifetime|since|noreturn", "false|none|true|undef", "this" type = "aliased|arena|byte|bool|closed|enum|fileoffs", "int|uint|wuint|int8|wuint8|int16|uint16|wuint16", "int32|uint32|wuint32|int64|uint64|wuint64", "own|ref|slot|funcref|ssize|usize|string|struct|threaded|var|writeonly" usertype = '\<[A-Z][[:alnum:]]*\>' symbol = "-","+","*","/","[+-/*!<>=]?=","<",">","->" cbracket = "{|}" # definitions of generic functions and methods: # func Type<...>.function_name<...>(...) (keyword,normal,function) = `(^func)([[:blank:]]+(?:[^#.]+\.])?)([[:alnum:]]+(?=[[:blank:]]*(?:<[^(]*>[[:blank:]]*)?\())` # function calls include "function.lang"