mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-11 21:13:50 -05:00
Merge 8f9e5af32d into f5393cfee0
This commit is contained in:
@@ -12,32 +12,63 @@ let b:current_syntax = "gleam"
|
|||||||
|
|
||||||
" Keywords
|
" Keywords
|
||||||
syntax keyword gleamKeyword
|
syntax keyword gleamKeyword
|
||||||
\ module import pub external
|
\ import pub panic use
|
||||||
\ type let as if else todo const
|
\ type let as if else todo const
|
||||||
\ case assert tuple try opaque
|
\ case assert try opaque
|
||||||
highlight link gleamKeyword Keyword
|
highlight link gleamKeyword Keyword
|
||||||
|
|
||||||
" Function definition
|
" Function definition
|
||||||
syntax keyword gleamDef fn nextgroup=gleamFunctionDef skipwhite skipempty
|
syntax keyword gleamDef fn nextgroup=gleamFunctionDef skipwhite skipempty
|
||||||
highlight link gleamDef Keyword
|
highlight link gleamDef Keyword
|
||||||
|
|
||||||
syntax match gleamFunctionDef "[a-z_-][0-9a-z_-]*" contained skipwhite skipnl
|
syntax match gleamFunctionDef "[a-z][a-z0-9_]*\ze\s*(" skipwhite skipnl
|
||||||
|
highlight link gleamFunctionDef Function
|
||||||
highlight link gleamFunctionDef Function
|
highlight link gleamFunctionDef Function
|
||||||
|
|
||||||
" Int
|
" Number
|
||||||
syntax match gleamInt '\<[0-9][0-9_]*\>'
|
"" Int
|
||||||
|
syntax match gleamInt '\<\(0*[1-9][0-9_]*|0\)\>'
|
||||||
highlight link gleamInt Number
|
highlight link gleamInt Number
|
||||||
|
|
||||||
" Float
|
"" Binary
|
||||||
syntax match gleamFloat '\<[0-9][0-9_]*\.[0-9_]*\>'
|
syntax match gleamBinary '\<0[bB]\(0*1[01_]*\|0\)\>'
|
||||||
|
highlight link gleamBinary Number
|
||||||
|
|
||||||
|
"" Octet
|
||||||
|
syntax match gleamOctet '\<0[oO]\(0*[1-7][0-7_]*\|0\)\>'
|
||||||
|
highlight link gleamOctet Number
|
||||||
|
|
||||||
|
"" Hexadecimal
|
||||||
|
syntax match gleamHexa '\<0[xX]\(0*[1-9a-zA-Z][0-9a-zA-Z_]*\|0\)\>'
|
||||||
|
highlight link gleamHexa Number
|
||||||
|
|
||||||
|
"" Float
|
||||||
|
syntax match gleamFloat '\(0*[1-9][0-9_]*\|0\)\.\(0*[1-9][0-9_]*\|0\)\=\(e-\=0*[1-9][0-9_]*\)\='
|
||||||
highlight link gleamFloat Float
|
highlight link gleamFloat Float
|
||||||
|
|
||||||
" Operators
|
" Operators
|
||||||
syntax match gleamOperator "\([-!#$%`&\*\+./<=>@\\^|~:]\|\<\>\)"
|
"" Basic
|
||||||
|
syntax match gleamOperator "[-+/*]\.\=\|[%=]"
|
||||||
|
highlight link gleamOperator Operator
|
||||||
|
|
||||||
|
"" Arrows + Pipeline
|
||||||
|
syntax match gleamOperator "<-\|[-|]>"
|
||||||
|
highlight link gleamOperator Operator
|
||||||
|
|
||||||
|
"" Bool
|
||||||
|
syntax match gleamOperator "&&\|||"
|
||||||
|
highlight link gleamOperator Operator
|
||||||
|
|
||||||
|
"" Comparison
|
||||||
|
syntax match gleamOperator "[<>]=\=\.\=\|[=!]="
|
||||||
|
highlight link gleamOperator Operator
|
||||||
|
|
||||||
|
"" Misc
|
||||||
|
syntax match gleamOperator "\.\.\|<>\||"
|
||||||
highlight link gleamOperator Operator
|
highlight link gleamOperator Operator
|
||||||
|
|
||||||
" Type
|
" Type
|
||||||
syntax match gleamType "\([a-z]\)\@<![A-Z]\w*"
|
syntax match gleamType "\<[A-Z][a-zA-Z0-9]*\>"
|
||||||
highlight link gleamType Identifier
|
highlight link gleamType Identifier
|
||||||
|
|
||||||
" Comments
|
" Comments
|
||||||
@@ -54,5 +85,5 @@ highlight link gleamString String
|
|||||||
highlight link gleamStringModifier Special
|
highlight link gleamStringModifier Special
|
||||||
|
|
||||||
" Attribute
|
" Attribute
|
||||||
syntax match gleamAttribute "#[a-z][a-z_]*"
|
syntax match gleamAttribute "@[a-z][a-z_]*"
|
||||||
highlight link gleamAttribute PreProc
|
highlight link gleamAttribute PreProc
|
||||||
|
|||||||
Reference in New Issue
Block a user