Skip to content

Instantly share code, notes, and snippets.

@desaperados
Last active February 5, 2020 09:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save desaperados/e712c0a3877391a199a4516aa5c11231 to your computer and use it in GitHub Desktop.
Save desaperados/e712c0a3877391a199a4516aa5c11231 to your computer and use it in GitHub Desktop.
" Vim syntax file
" Language: Act
" Maintainer: dc
" Latest Revision: December 2019
" Keywords
syn keyword actKeyword types storage iff if of returnsRaw
syn keyword actKeyword returns balance gas pc calls stack
syn match actKeyword "\<for all\>"
syn match actKeyword "\<such that\>"
" Types
syn keyword actType bool uint int uint32 uint48 uint112 uint256 int256 address bytes32
" Constants
syn keyword actConstant ACCT_ID CALLER_ID TIME VCallValue VCallDepth 0
" Behaviour
syn keyword actBehaviour behaviour nextgroup=actBehaviourDecl
" Interface
syn keyword actInterface interface nextgroup=actInterfaceDecl
" Operators
syn match actOperator "+\-"
syn match actOperator "\v>\<"
syn match actOperator "\v>=\<="
syn match actOperator "=\=="
syn match actOperator ":"
syn match actOperator "=>"
syn match actOperator "|->"
syn match actOperator "/"
syn match actOperator "\*"
syn match actOperator "mod"
syn match actOperator "pow\d*"
" Mapping
syn match actMapping "\[\|\]"
" K
syn match kOperator "-Word"
syn match Function "#\{1}\w*"
syn keyword Function chop
syn match Conditional "#if"
syn match Conditional "#fi"
syn match Conditional "#then"
syn match Conditional "#else"
" Comments
syn keyword actTodo FIXME NOTE TODO contained
syn match actComment "//.*$" contains=actTodo
" Highlight Groups
hi def link actComment Comment
hi def link actKeyword Keyword
hi def link actInterface Keyword
hi def link actBehaviour Keyword
hi def link actFunction Function
hi def link actConstant Constant
hi def link actOperator Operator
hi def link kOperator Operator
hi def link actType Type
hi def link actK Identifier
hi def link actMapping Identifier
let b:current_syntax = "act"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment