mirror of
https://github.com/zyedidia/micro.git
synced 2025-06-18 14:55:38 -04:00
Add go.mod syntax support (#3061)
Signed-off-by: Yevhen Babiichuk (DustDFG) <dfgdust@gmail.com>
This commit is contained in:
parent
e5a9b906f3
commit
fce8db80de
31
runtime/syntax/gomod.yaml
Normal file
31
runtime/syntax/gomod.yaml
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
filetype: gomod
|
||||||
|
|
||||||
|
detect:
|
||||||
|
filename: "go.mod"
|
||||||
|
|
||||||
|
rules:
|
||||||
|
# URL
|
||||||
|
- type: "(^|[ \\t])+\\b([a-zA-Z0-9-]+\\.?)+(/[a-zA-Z0-9-_\\.]+)*\\b"
|
||||||
|
|
||||||
|
# Keywords
|
||||||
|
- special: "(^|[ \\t])+\\b(module|go)\\b"
|
||||||
|
- preproc: "(^|[ \\t])+\\b(toolchain|require|exclude|replace|retract)\\b"
|
||||||
|
- symbol.operator: "=>"
|
||||||
|
|
||||||
|
# Brackets
|
||||||
|
- type: "(\\(|\\))"
|
||||||
|
|
||||||
|
# Go version
|
||||||
|
- type: "(^|[ \\t])+([0-9]+\\.?)+"
|
||||||
|
|
||||||
|
# Version
|
||||||
|
- constant.string: "(^|[ \\t])+v([0-9]+\\.?){3}.*"
|
||||||
|
- constant.number: "(^|[ \\t])+v([0-9]+\\.?){3}"
|
||||||
|
|
||||||
|
- comment:
|
||||||
|
start: "//"
|
||||||
|
end: "$"
|
||||||
|
rules:
|
||||||
|
- todo: "(indirect):?"
|
||||||
|
|
||||||
|
# (^|[ \\t])+ means after start of string or space or tab character
|
Loading…
Reference in New Issue
Block a user