mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-29 14:22:42 +09:00
syntax: add Gleam language support (#4045)
This commit is contained in:
committed by
GitHub
parent
d976b3f170
commit
4d04ad7290
69
runtime/syntax/gleam.yaml
Normal file
69
runtime/syntax/gleam.yaml
Normal file
@@ -0,0 +1,69 @@
|
||||
filetype: gleam
|
||||
|
||||
detect:
|
||||
filename: "\\.gleam$"
|
||||
|
||||
rules:
|
||||
- identifier: "\\b[a-z][a-z0-9_]*\\b"
|
||||
|
||||
- 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"
|
||||
|
||||
- type: "\\b[A-Z][a-zA-Z0-9_]*\\b"
|
||||
|
||||
- type: "\\b(Int|Float|String|Bool|List|Option|Result|BitArray)\\b"
|
||||
|
||||
- constant: "\\b(True|False|Nil)\\b"
|
||||
|
||||
- preproc: "@[a-z][a-z_]*"
|
||||
|
||||
- statement: "(\\|>|->|<-)"
|
||||
- statement: "(\\.\\.|<>)"
|
||||
- statement: "(==|!=|<=\\.|>=\\.|<\\.|>\\.|<=|>=)"
|
||||
- statement: "(&&|\\|\\|)"
|
||||
- statement: "(\\+\\.|-\\.|\\*\\.|/\\.|\\+|-|\\*|/|%)"
|
||||
- statement: "(=|<|>|!|<<|>>)"
|
||||
|
||||
- constant.number: "\\b0b[01](_?[01])*\\b"
|
||||
- constant.number: "\\b0o[0-7](_?[0-7])*\\b"
|
||||
- constant.number: "\\b0x[0-9a-fA-F](_?[0-9a-fA-F])*\\b"
|
||||
- constant.number: "\\b[0-9](_?[0-9])*(\\.[0-9](_?[0-9])*)?([eE][+-]?[0-9](_?[0-9])*)?\\b"
|
||||
|
||||
- default:
|
||||
start: "#\\("
|
||||
end: "\\)"
|
||||
limit-group: special
|
||||
rules:
|
||||
- identifier: "\\b[a-z][a-z0-9_]*\\b"
|
||||
- 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"
|
||||
- type: "\\b[A-Z][a-zA-Z0-9_]*\\b"
|
||||
- type: "\\b(Int|Float|String|Bool|List|Option|Result|BitArray)\\b"
|
||||
- constant: "\\b(True|False|Nil)\\b"
|
||||
- statement: "(\\|>|->|<-)"
|
||||
- statement: "(\\.\\.|<>)"
|
||||
- statement: "(==|!=|<=\\.|>=\\.|<\\.|>\\.|<=|>=)"
|
||||
- statement: "(&&|\\|\\|)"
|
||||
- statement: "(\\+\\.|-\\.|\\*\\.|/\\.|\\+|-|\\*|/|%)"
|
||||
- statement: "(=|<|>|!|<<|>>)"
|
||||
- constant.number: "\\b0b[01](_?[01])*\\b"
|
||||
- constant.number: "\\b0o[0-7](_?[0-7])*\\b"
|
||||
- constant.number: "\\b0x[0-9a-fA-F](_?[0-9a-fA-F])*\\b"
|
||||
- constant.number: "\\b[0-9](_?[0-9])*(\\.[0-9](_?[0-9])*)?([eE][+-]?[0-9](_?[0-9])*)?\\b"
|
||||
- constant.string:
|
||||
start: '"'
|
||||
end: '"'
|
||||
skip: "\\\\."
|
||||
rules:
|
||||
- constant.specialChar: "\\\\."
|
||||
|
||||
- constant.string:
|
||||
start: '"'
|
||||
end: '"'
|
||||
skip: "\\\\."
|
||||
rules:
|
||||
- constant.specialChar: "\\\\."
|
||||
|
||||
- comment:
|
||||
start: "//"
|
||||
end: "$"
|
||||
rules:
|
||||
- todo: "(TODO|FIXME|XXX):?"
|
||||
Reference in New Issue
Block a user