|
| 1 | +filetype: gleam |
| 2 | + |
| 3 | +detect: |
| 4 | + filename: "\\.gleam$" |
| 5 | + |
| 6 | +rules: |
| 7 | + - identifier: "\\b[a-z][a-z0-9_]*\\b" |
| 8 | + |
| 9 | + - statement: "\\b(as|assert|auto|case|const|delegate|derive|echo|else|fn|if|implement|import|let|macro|opaque|panic|pub|test|todo|type|use)\\b" |
| 10 | + |
| 11 | + - type: "\\b[A-Z][a-zA-Z0-9_]*\\b" |
| 12 | + |
| 13 | + - type: "\\b(Int|Float|String|Bool|List|Option|Result|BitArray)\\b" |
| 14 | + |
| 15 | + - constant: "\\b(True|False|Nil)\\b" |
| 16 | + |
| 17 | + - preproc: "@[a-z][a-z_]*" |
| 18 | + |
| 19 | + - statement: "(\\|>|->|<-)" |
| 20 | + - statement: "(\\.\\.|<>)" |
| 21 | + - statement: "(==|!=|<=\\.|>=\\.|<\\.|>\\.|<=|>=)" |
| 22 | + - statement: "(&&|\\|\\|)" |
| 23 | + - statement: "(\\+\\.|-\\.|\\*\\.|/\\.|\\+|-|\\*|/|%)" |
| 24 | + - statement: "(=|<|>|!|<<|>>)" |
| 25 | + |
| 26 | + - constant.number: "\\b0b[01](_?[01])*\\b" |
| 27 | + - constant.number: "\\b0o[0-7](_?[0-7])*\\b" |
| 28 | + - constant.number: "\\b0x[0-9a-fA-F](_?[0-9a-fA-F])*\\b" |
| 29 | + - constant.number: "\\b[0-9](_?[0-9])*(\\.[0-9](_?[0-9])*)?([eE][+-]?[0-9](_?[0-9])*)?\\b" |
| 30 | + |
| 31 | + - default: |
| 32 | + start: "#\\(" |
| 33 | + end: "\\)" |
| 34 | + limit-group: special |
| 35 | + rules: |
| 36 | + - identifier: "\\b[a-z][a-z0-9_]*\\b" |
| 37 | + - statement: "\\b(as|assert|auto|case|const|delegate|derive|echo|else|fn|if|implement|import|let|macro|opaque|panic|pub|test|todo|type|use)\\b" |
| 38 | + - type: "\\b[A-Z][a-zA-Z0-9_]*\\b" |
| 39 | + - type: "\\b(Int|Float|String|Bool|List|Option|Result|BitArray)\\b" |
| 40 | + - constant: "\\b(True|False|Nil)\\b" |
| 41 | + - statement: "(\\|>|->|<-)" |
| 42 | + - statement: "(\\.\\.|<>)" |
| 43 | + - statement: "(==|!=|<=\\.|>=\\.|<\\.|>\\.|<=|>=)" |
| 44 | + - statement: "(&&|\\|\\|)" |
| 45 | + - statement: "(\\+\\.|-\\.|\\*\\.|/\\.|\\+|-|\\*|/|%)" |
| 46 | + - statement: "(=|<|>|!|<<|>>)" |
| 47 | + - constant.number: "\\b0b[01](_?[01])*\\b" |
| 48 | + - constant.number: "\\b0o[0-7](_?[0-7])*\\b" |
| 49 | + - constant.number: "\\b0x[0-9a-fA-F](_?[0-9a-fA-F])*\\b" |
| 50 | + - constant.number: "\\b[0-9](_?[0-9])*(\\.[0-9](_?[0-9])*)?([eE][+-]?[0-9](_?[0-9])*)?\\b" |
| 51 | + - constant.string: |
| 52 | + start: '"' |
| 53 | + end: '"' |
| 54 | + skip: "\\\\." |
| 55 | + rules: |
| 56 | + - constant.specialChar: "\\\\." |
| 57 | + |
| 58 | + - constant.string: |
| 59 | + start: '"' |
| 60 | + end: '"' |
| 61 | + skip: "\\\\." |
| 62 | + rules: |
| 63 | + - constant.specialChar: "\\\\." |
| 64 | + |
| 65 | + - comment: |
| 66 | + start: "//" |
| 67 | + end: "$" |
| 68 | + rules: |
| 69 | + - todo: "(TODO|FIXME|XXX):?" |
0 commit comments