zk.vim 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. " Syntax highlighting for zkas scripts.
  2. " Symlink into ~/.vim/syntax/zk.vim
  3. " Add to your vim init file:
  4. " au BufNewFile,BufRead,BufReadPost *.zk set syntax=zk
  5. if exists("b:current_syntax")
  6. finish
  7. endif
  8. syn keyword zkasKeyword
  9. \ k
  10. \ field
  11. \ constant
  12. \ witness
  13. \ circuit
  14. syn keyword zkasType
  15. \ EcPoint EcFixedPoint EcFixedPointBase EcFixedPointShort EcNiPoint
  16. \ Base BaseArray Scalar ScalarArray
  17. \ MerklePath Uint32 Uint64
  18. syn keyword zkasInstruction
  19. \ ec_add ec_mul ec_mul_base ec_mul_short ec_mul_var_base
  20. \ ec_get_x ec_get_y
  21. \ base_add base_mul base_sub
  22. \ poseidon_hash merkle_root
  23. \ range_check less_than_strict less_than_loose bool_check
  24. \ cond_select zero_cond witness_base
  25. \ constrain_equal_base constrain_equal_point
  26. \ constrain_instance debug
  27. syn region zkasString start='"' end='"' contained
  28. syn keyword zkasTodo contained TODO FIXME XXX NOTE
  29. syn match zkasComment "#.*$" contains=zkasTodo
  30. hi def link zkasKeyword Statement
  31. hi def link zkasType Type
  32. hi def link zkasInstruction Function
  33. hi def link zkasString Constant
  34. hi def link zkasTodo Todo
  35. hi def link zkasComment Comment
  36. let b:current_syntax = "zk"