diff options
| author | Calvin Morrison <calvin@pobox.com> | 2026-06-23 16:38:48 -0400 |
|---|---|---|
| committer | Calvin Morrison <calvin@pobox.com> | 2026-06-23 16:38:48 -0400 |
| commit | 66818f40225eb2c2722ba62a3743e478d9111b03 (patch) | |
| tree | 7dafd5994668a56578418ceea069bc7d8d020f18 /syntax/pvx.vim | |
Highlights comments, strings, labels, control flow, and the object
method-call operator; indents to match the convention encoded in
native-sage-connector's formatpvx.pl (one tab per block level).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'syntax/pvx.vim')
| -rw-r--r-- | syntax/pvx.vim | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/syntax/pvx.vim b/syntax/pvx.vim new file mode 100644 index 0000000..d7210a4 --- /dev/null +++ b/syntax/pvx.vim @@ -0,0 +1,76 @@ +" Vim syntax file +" Language: ProvideX / PVX (Sage 100 business object source, *.pvxsrc) +" Maintainer: native-sage-connector + +if exists("b:current_syntax") + finish +endif + +" PVX keywords are case-insensitive in practice (mixed-case is common). +syntax case ignore + +" --- Comments ------------------------------------------------------- +syn keyword pvxTodo TODO FIXME XXX NOTE contained +syn match pvxComment "!.*$" contains=pvxTodo,@Spell + +" --- Strings & literals --------------------------------------------- +" Doubled quotes ("") inside a string are a literal embedded quote. +syn region pvxString start=/"/ skip=/""/ end=/"/ + +" $$ is the "any/blank key" marker used in select/begin ranges. +syn match pvxByteLiteral "\$\$" +" $XX$ is a two-digit hex byte literal, e.g. $8A$ (field separator). +syn match pvxByteLiteral "\$[0-9A-Fa-f][0-9A-Fa-f]\$" + +syn match pvxNumber "\<\d\+\(\.\d\+\)\?\>" + +" Pseudo-labels used as err=/dom= targets (*next, *break, *resume, ...) +syn match pvxPseudoLabel "\*\h\w*" + +" Labels: BARE_WORD: alone on a line (optionally trailing a comment) +syn match pvxLabel "^\s*[A-Za-z_][A-Za-z0-9_.]*:\s*\(!.*\)\=$" + +" Object method-call operator: obj'MethodName( +syn match pvxMethodCall "'\h\w*" + +" --- Statements / control flow -------------------------------------- +syn keyword pvxConditional if then else switch case default +syn keyword pvxRepeat for to step next while wend repeat until +syn keyword pvxLabelKw break continue exit goto gosub return stop + +syn keyword pvxStatement + \ open close read write dim remove call select from begin where + \ sep iol rec key err dom execute drop object on error try catch + \ finally let print input rem + +syn keyword pvxStructure + \ def class like function perform local public global common + \ create delete required end + +syn keyword pvxOperator and or not + +" --- Built-in functions ---------------------------------------------- +syn keyword pvxFunction + \ nul pos tbl ucs lcs mid str stp pad varchar sub new find len + \ num evn clear msg dte lst vis dll max min val kec tim mod fib + \ lof eof dir exists chr asc int sqr rnd cvs cvt day abs kgen + \ ioc iol ios opt lpt ptr env exp log pi sgn dle fin fid dlm dod + +" --- Highlight links -------------------------------------------------- +hi def link pvxComment Comment +hi def link pvxTodo Todo +hi def link pvxString String +hi def link pvxByteLiteral SpecialChar +hi def link pvxNumber Number +hi def link pvxPseudoLabel Special +hi def link pvxLabel Label +hi def link pvxMethodCall Function +hi def link pvxConditional Conditional +hi def link pvxRepeat Repeat +hi def link pvxLabelKw Keyword +hi def link pvxStatement Statement +hi def link pvxStructure Structure +hi def link pvxOperator Operator +hi def link pvxFunction Function + +let b:current_syntax = "pvx" |
