Hi all - I'm looking to improve the syntax file for '8th' (8th-dev.com).
The language is a Forth (like my previous Reva Forth), but uses JSON as a data-description language. I'm looking to improve the embedded JSON highlighting among other things. The keywords list is automatically generated by my build process. If anyone has suggestions on what other syntax files I might look at for help, or to offer help, I would appreciate it. For reference, here's the current syntax file: " Vim syntax file " Language: 8th " Version: 1.0.2 " Maintainer: Ron Aaron <ron at aaron-tech.com> " URL: http://8th-dev.com/ " Filetypes: *.8th " NOTE: You should also have the ftplugin/8th.vim file to set 'isk' if version < 600 syntax clear finish elseif exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim syn clear " Synchronization method syn sync ccomment syn sync maxlines=100 syn case match syn match eighthColonName "\S\+" contained syn match eighthColonDef ":\s\+\S\+" contains=eighthColonName " new words syn match eighthClasses "\<\S\+:" contained syn match eighthClassWord "\<\S\+:.\+" contains=eighthClasses syn keyword eighthEndOfColonDef ; i; syn keyword eighthDefine var var, " Built in words com! -nargs=+ Builtin syn keyword eighthBuiltin <args> "Builtin ^ < <# <#> = > - -- ,# ; ;; ! ??? / . .# ' () @ * */ \ Builtin ! !const #! ## #> ' ( (:) (getc) (gets) (putc) (puts) (putslim) ) * */ + +! +child +match +ref Builtin ,# - -- -Inf -child -ref -rot . .# .r .s .stats .ver .with / /mod /path 1+ 1- 2drop 2dup 2over Builtin 2swap 8thdir 8thver? : ; ;; ;with < <# <#> = > >base64 >buf >clip >decrypt >encrypt >file >fixed Builtin >json >kind >msec >n >progress >r >s >unix >url ??? @ BLAKE DGRAM INET4 INET6 Inf MD5 NaN NaN? Builtin PI SHA1 SHA256 STREAM \ ^ ` abs abspath accept acos add-items adjustwidth again and appname Builtin apropos arc arc2 argc args asin assert asset assetdir associate atan atan2 attr! attr@ attrs Builtin autohide back band base base64> between bfloat bg bg? bind bint bits black blue bold bor bounds Builtin bounds? box-label bp break break? bubble build? buildver? button-size buttons-visible bye c# Builtin c-text callout camera camera-fmt camera-img camera-preview camera? caseof ceil center chdir Builtin child chmod clamp class class>s clear clearpath clip> clone close clreol cls cmp cmpi col cold Builtin color colordlg compile compress conflict connect connectededges const copy copydir cos cpu? Builtin cr create ctime curlen cyan datadir decimal decrypt+ decrypt> default-font defer: deg>rad del Builtin depth destroy device? dial die dim dir? dismiss displays? displaysize? dname do down draw-text Builtin draw-text-at drop dump dup each eachbuf eachline edit-on-double-click editable else empty-text Builtin enable enabled? encrypt+ encrypt> err? eval eval! exec exec-cb exec? execnull exename exists? Builtin exp expand false fb-files fg fg? file-filter file-name filedlg fill filter find fixed> float Builtin floor flush fmt fname fnv focus forget format forward frac free freeaddrinfo fullscreen func: Builtin genkey get getaddrinfo getc getclr getcwd getenv getimage getline getmod getroot gets getxy Builtin glob go gotoxy gradient green handle handler hash hash+ hash>b hash>s head help hex hide hmac Builtin i: i; if image include insert int intl invalidate is itemlist ix? join json-pretty json> key Builtin key? keys kill l-text l: laf laf! laf? lang last launch lc left len lend? lib libinclude line Builtin line-width lineto link link> link? listen literal ln loadcontent lock lock-to locked? log loop Builtin loop- lsub mac? magenta main map match max mem? menuenabled min mkdir mobile? mod moveto msec Builtin msec> msgdlg mtime multi mv n# name needs neg new nip nobold noop normal not notify nouscore Builtin ns ns: null null? obj on on? onBlack onBlue onCyan onGreen onMagenta onRed onWhite onYellow Builtin onexit only op open or os outlinethickness over p: pack parent parse parseln parsews path peek Builtin phone phone? pick pie pix! pix@ play poll pop pos? post prepare print prior priority progress-task Builtin progress-task-msg progress-task-pct prompt propval! propval@ pump push put putc puts putslim Builtin quit quote r-text r> r@ rad>deg rand randbuf randkey rdrop read readonly recurse red redir? Builtin reduce ref@ refresh relpath repeat replace replace! reset restore rev rglob right rm rmdir Builtin root root-item-visible rot rotate round rowheight rpick rsa_decrypt rsa_encrypt rsa_sign rsa_verify Builtin rsagenkey rsearch rstack rsub rswap same? save say scale scriptdir scrollthickness search sectionenable Builtin seek select! select@ sensor sep set-long-press set-swipe setenv setfont setheader setimage Builtin setname setroot settab sgn sh sh$ show show-line-numbers show-pct showmenu sin size size? sleep Builtin slice slurp sms socket sort space sqr sqrt start stat state state? stderr stdin stdout stepsize Builtin stop stroke style super! super@ swap sysquit tag@ tan task tell tempdir tempfilename text text-box-style Builtin text? text@ textsize then throw throwing thrownull times toggled? tooltip translate trash tree-open Builtin triangle true trunc tsub tuck u! u@ uc unix> unlock unpack up url url> uscore user user! var Builtin var, vertical view visible? volume volume? wait when when! while white winding with: words Builtin write writen xor xy xy? yellow zip zip+ zip@ zipentry zipnew zipopen zipsave zt " numbers syn keyword eighthMath decimal hex base@ base! syn match eighthInteger '\<-\=[0-9.]*[0-9.]\+\>' " recognize hex and binary numbers, the '$' and '%' notation is for eighth syn match eighthInteger '\<\$\x*\x\+\>' " *1* --- dont't mess syn match eighthInteger '\<\x*\d\x*\>' " *2* --- this order! syn match eighthInteger '\<%[0-1]*[0-1]\+\>' syn match eighthInteger "\<'.\>" " Strings syn region eighthString start=+\.\?\"+ skip=+"+ end=+$+ syn keyword jsonNull null syn keyword jsonBool /\(true\|false\)/ syn region eighthString start=/\<"/ end=/"\>/ syn match jsonObjEntry /"\"[^"]\+\"\ze\s*:/ "syn region jsonObject start=/{/ end=/}/ contained contains=jsonObjEntry,jsonArray,jsonObject, jsonBool, eighthString "syn region jsonArray start=/\[/ end=/\]/ contained contains=jsonArray,jsonObject, jsonBool, eighthString " Include files " syn match eighthInclude '\<\(libinclude\|include\|needs\)\s\+\S\+' syn region eighthComment start="\zs\\" end="$" contains=eighthTodo " Define the default highlighting. if !exists("did_eighth_syntax_inits") let did_eighth_syntax_inits=1 " The default methods for highlighting. Can be overriden later. hi def link eighthTodo Todo hi def link eighthOperators Operator hi def link eighthMath Number hi def link eighthInteger Number hi def link eighthStack Special hi def link eighthFStack Special hi def link eighthSP Special hi def link eighthColonDef Define hi def link eighthColonName Operator hi def link eighthEndOfColonDef Define hi def link eighthDefine Define hi def link eighthDebug Debug hi def link eighthCharOps Character hi def link eighthConversion String hi def link eighthForth Statement hi def link eighthVocs Statement hi def link eighthString String hi def link eighthComment Comment hi def link eighthClassDef Define hi def link eighthEndOfClassDef Define hi def link eighthObjectDef Define hi def link eighthEndOfObjectDef Define hi def link eighthInclude Include hi def link eighthBuiltin Define hi def link eighthClasses Define hi def link eighthClassWord Keyword hi def link jsonObject Delimiter hi def link jsonObjEntry Label hi def link jsonArray Special hi def link jsonNull Function hi def link jsonBool Boolean endif let b:current_syntax = "8th" let &cpo = s:cpo_save unlet s:cpo_save " vim: ts=8:sw=4:nocindent:smartindent: -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
