]> git.lizzy.rs Git - micro.git/blob - runtime/syntax/erlang.yaml
Ignore tool files
[micro.git] / runtime / syntax / erlang.yaml
1 filetype: erlang
2
3 detect:
4     filename: "\\.erl$"
5
6 rules:
7     - identifier: "\\b[A-Z][0-9a-z_]*\\b"
8     # See: http://erlang.org/doc/reference_manual/data_types.html
9     - constant.number: "\\b[0-9]+(\\.[0-9]+)?(e-?[0-9]+)?\\b"
10     - constant.number: "\\b[0-9]{1,2}\\#[a-zA-Z0-9]+\\b"
11     - constant.bool: "\\b(true|false)\\b"
12     - constant.number: "\\$\\\\?\\S{1}"
13     # See: http://erlang.org/doc/reference_manual/introduction.html
14     - statement: "\\b(after|and|andalso|band|begin|bnot|bor|bsl|bsr|bxor|case|catch|cond|div|end|fun|if|let|not|of|or|orelse|receive|rem|try|when|xor)\\b"
15     # See: http://erlang.org/doc/reference_manual/macros.html
16     - preproc: "\\-(module|export|record|include|include_lib|define|undef|ifdef|ifndef|else|endif|if|elif|error|warning)\\b"
17     - identifier.macro: "\\?[A-Z0-9_]+\\b"
18     # See: http://erlang.org/doc/man/erlang.html
19     - special: "\\b(ext_binary|binary|iovec|message_queue_data|time(_unit|stamp)|abs|apply|atom(_to_binary|_to_list)|binary_(part|to_atom|to_existing_atom|to_float|to_integer|to_list|to_term)|bit(_size|string_to_list)|byte_size|ceil|check_(old_code|process_code)|date|delete_module|demonitor|disconnect_node|element|erase|error|exit|float(_to_binary|_to_list)?|floor|garbage_collect|get|group_leader|halt|integer(_to_binary|to_list)|iolist_(size|to_binary)|is_(alive|atom|binary|bitstring|boolean|float|function|integer|list|map|map_key|number|pid|port|process_alive|record|reference|tuple|length)|link|list_to_(atom|binary|bitstring|existing_atom|float|integer|pid|port|ref|tuple)|load_module|make_ref|map_(get|size)|max|min|module_loaded|monitor(_node)?|nodes?|now|open_port|pid_to_list|port(_close|command|connect|control|to_list)|pre_loaded|process(_flag|_info|es)|purge_module|put|register(ed)?|round|self|setelement|size|spawn(_link|_monitor|_opt|_binary)?|statistics|trunc|tuple_(size|to_list)|unlink|unregister|whereis)\\b"
20     # See: http://erlang.org/doc/reference_manual/data_types.html#atom
21     - symbol:
22         start: "'"
23         end: "'"
24         skip: "\\\\."
25         rules: []
26 #            - constant.specialChar: "%."
27 #            - constant.specialChar: "\\\\[abfnrtv'\\\"\\\\]"
28 #            - constant.specialChar: "\\\\([0-7]{3}|x[A-Fa-f0-9]{2}|u[A-Fa-f0-9]{4}|U[A-Fa-f0-9]{8})"
29     - constant.string:
30         start: "\""
31         end: "\""
32         skip: "\\\\."
33         rules:
34             - constant.specialChar: "%."
35             - constant.specialChar: "\\\\[abfnrtv'\\\"\\\\]"
36             - constant.specialChar: "\\\\([0-7]{3}|x[A-Fa-f0-9]{2}|u[A-Fa-f0-9]{4}|U[A-Fa-f0-9]{8})"
37     - comment:
38         start: "\\(\\*"
39         end: "\\*\\)"
40         rules:
41             - todo: "(TODO|FIXME|WONTFIX|NOTE|HACK):?"
42     - comment:
43         start: "%"
44         end: "$"
45         rules: []