Debian Codegraph @

runtime/syntax/julia.yaml

raw
1 filetype: julia
2
3 detect:
4 filename: "\\.jl$"
5 header: "^#!.*/(env +)?julia( |$)"
6
7 rules:
8
9 # built-in objects
10 - constant.bool: "\\b(true|false)\\b"
11 - constant: "\\b(nothing|missing)\\b"
12 # built-in attributes
13 - constant: "__[A-Za-z0-9_]+__"
14 # definitions
15 - identifier: "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[(]"
16 # keywords
17 - statement: "\\b(baremodule|begin|break|catch|const|continue|do|else|elseif|end|export|finally|for|function|global|if|import|let|local|macro|module|public|quote|return|struct|try|using|while)\\b"
18 - statement: "\\b(abstract\\s+type|primitive\\s+type|mutable\\s+struct)\\b"
19 # decorators
20 - identifier.macro: "@[A-Za-z0-9_]+"
21 # operators
22 - symbol.operator: "[:+*|=!%~<>/\\-?&\\\\รทโˆˆโˆ‰โˆ˜]|\\b(in|isa|where)\\b"
23 # for some reason having ^ in the same regex with the other operators broke things
24 - symbol.operator: "\\^"
25 # parentheses
26 - symbol.brackets: "([(){}]|\\[|\\])"
27 # numbers
28 - constant.number: "\\b([0-9]+(_[0-9]+)*|0x[0-9a-fA-F]+(_[0-9a-fA-F]+)*|0b[01]+(_[01]+)*|0o[0-7]+(_[0-7]+)*|Inf(16|32|64)?|NaN(16|32|64)?)\\b"
29
30 - constant.string:
31 start: "\"\"\""
32 end: "\"\"\""
33 rules: []
34
35 - constant.string:
36 start: "\""
37 end: "\""
38 skip: "\\\\."
39 rules:
40 - constant.specialChar: "\\\\([\"'abfnrtv\\\\]|[0-3]?[0-7]{1,2}|x[0-9A-Fa-f]{1,2}|u[0-9A-Fa-f]{1,4}|U[0-9A-Fa-f]{1,8})"
41
42 # Lifted from Rust's syntax highlighting
43 - constant.string: "'(\\\\.|.)'"
44 - constant.string:
45 start: "'\""
46 end: "'"
47 rules: []
48
49 - comment:
50 start: "#="
51 end: "=#"
52 rules: []
53
54 - comment:
55 start: "#"
56 end: "$"
57 rules: []