zk.vim 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. \ constant
  11. \ witness
  12. \ circuit
  13. syn keyword zkasType
  14. \ EcPoint EcFixedPoint EcFixedPointBase EcFixedPointShort EcNiPoint
  15. \ Base BaseArray Scalar ScalarArray
  16. \ MerklePath Uint32 Uint64
  17. syn keyword zkasInstruction
  18. \ ec_add ec_mul ec_mul_base ec_mul_short ec_mul_var_base
  19. \ ec_get_x ec_get_y
  20. \ base_add base_mul base_sub
  21. \ poseidon_hash merkle_root
  22. \ range_check less_than_strict less_than_loose bool_check
  23. \ cond_select zero_cond witness_base
  24. \ constrain_equal_base constrain_equal_point
  25. \ constrain_instance debug
  26. syn region zkasString start='"' end='"' contained
  27. syn keyword zkasTodo contained TODO FIXME XXX NOTE
  28. syn match zkasComment "#.*$" contains=zkasTodo
  29. hi def link zkasKeyword Statement
  30. hi def link zkasType Type
  31. hi def link zkasInstruction Function
  32. hi def link zkasString Constant
  33. hi def link zkasTodo Todo
  34. hi def link zkasComment Comment
  35. let b:current_syntax = "zk"