From 105a6cf55c4dee18e2e4b025c91cb4d2dec9276d Mon Sep 17 00:00:00 2001 From: Philip Monk Date: Mon, 30 Sep 2013 12:55:26 -0700 Subject: [PATCH 1/5] As per Curtis's suggestion, highlight atom odors. --- syntax/hoon.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntax/hoon.vim b/syntax/hoon.vim index 239678908..fdd68eafc 100644 --- a/syntax/hoon.vim +++ b/syntax/hoon.vim @@ -27,7 +27,7 @@ hi def link hoonString String syn match hoonDeclaration "++" nextgroup=hoonSymbolDec skipwhite syn match hoonSymbol /%\w*/ "syn match hoonBranch /?[^\w\s]/ -syn keyword hoonAtom @ +syn match hoonAtom /@\w*/ syn match hoonName "\w*" contained syn match hoonSymbolDec "\w*" contained contains=hoonName From eca34fa656b068a7a9dec30cc272cd84a4ec302b Mon Sep 17 00:00:00 2001 From: Philip Monk Date: Mon, 30 Sep 2013 13:00:40 -0700 Subject: [PATCH 2/5] As per Curtis's suggestion, remove identifier highlighting. --- syntax/hoon.vim | 2 -- 1 file changed, 2 deletions(-) diff --git a/syntax/hoon.vim b/syntax/hoon.vim index fdd68eafc..ea93beb2f 100644 --- a/syntax/hoon.vim +++ b/syntax/hoon.vim @@ -167,7 +167,5 @@ syn match hoonRune "!=" " These are just pulled from hoon.hoon using: " cat hoon.hoon | sed -n -e 's/^++ \<\([^ ]*\)\>.*/\1/p' -syn keyword hoonIdentifier stub axis beer bloq bozo calf char chop claw coat coil coin cord date dime dram edge foot gear gene gens gent genu goon hair hapt like limb line list odor tarp time tree nail pass path pint port prop reef ring rule shoe span spot tank tape term tile tone tool toon tope tune type udal udon ulna umph unit upas urge vase vise wall wing wine wonk map qeu set add cap dec div gte gth lte lth mas max min mod mul peg sub bind clap drop fall mate need some flop homo lent levy lien reel roll skid skim skip scag slag snag sort swag turn weld from long lone mill none over pull push spin bex can cat cut end lsh met rap rep rip rsh con dis mix aor dor gor hor vor fnv mug po si fe rlyd rlyh rlyq rlys ryld rylh rylq ryls year yore yell yule yall yawn yelp yo hard soft apt in ept by to mo sa cue jam mat rub last lust cold cook easy fail full funk here jest just knee mask next sear shim stag stew stir stun bend comp glue pfix plug pose sfix bass boss ifix more most plus slug star ace bar bas buc cab cen col com doq dot fas gal gar hax kel ker ket lus hep pel pam per pat sel sem ser sig soq tar tec tis wut zap dog doh dun duq duz gap gay vul alf aln alp bet bin but dem dit gul gon hex hig hit low mes nix nud poy qit qut sym ven vit rash rush scan cass crip mesc runt sand sane trim trip teff turf tuba tufa tuft wack wick woad wood re ab ag co ne mu so scot scow slaw slay smyt un mack mink mock mook mang mong mung berk diff loss locz lore role lump limp hump husk lurk lusk shad shaf shak sham shas shax shaw og show at cell core cube face bean flay foil fork cove comb cond cons fitz flan flip flor hike hoax hoof jock look make rain ream reck seed sell pave loot slam slim slit slap slop skol spat spud slot slum stab wash al ap ut vang vast vest vice curd duct helm hilt move ovum pane pone ship vane vile wire writ adit vent vial vint is come keep load peek poke veer volt wish - let b:current_syntax = "hoon" From 1f0f4a30bfc60b26f1f2d42e500a76867a83d830 Mon Sep 17 00:00:00 2001 From: Philip Monk Date: Mon, 30 Sep 2013 13:12:34 -0700 Subject: [PATCH 3/5] Changed hoonAtom to Identifier. I think this is better? --- syntax/hoon.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntax/hoon.vim b/syntax/hoon.vim index ea93beb2f..3102c20a7 100644 --- a/syntax/hoon.vim +++ b/syntax/hoon.vim @@ -13,7 +13,7 @@ syn case match " Declerations hi def link hoonDeclaration Define hi def link hoonSymbol Constant -hi def link hoonAtom Keyword +hi def link hoonAtom Identifier hi def link hoonRune Operator hi def link hoonIdentifier Identifier hi def link hoonBranch Conditional From ed79f644b7914d761a2b5e8bccff62d741b59d20 Mon Sep 17 00:00:00 2001 From: Philip Monk Date: Mon, 30 Sep 2013 17:12:41 -0700 Subject: [PATCH 4/5] Improved number matching to match across whitespace. --- syntax/hoon.vim | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/syntax/hoon.vim b/syntax/hoon.vim index 3102c20a7..3a8bc3399 100644 --- a/syntax/hoon.vim +++ b/syntax/hoon.vim @@ -37,9 +37,11 @@ syn match hoonSymbolDec "\w*" contained contains=hoonName " XXX It appears that a number can span lines if (and only if?) the lines end " in a dot. This mostly causes issues with hex numbers across mulitple lines " (as in hoon.hoon line 3067). -syn match hoonNumber "[0123456789]\+[0123456789\.]*" -syn match hoonNumber "0x[0123456789abcdef]\+[0123456789abcdef\.]*" -syn match hoonNumber "0b[01]\+[01\.]*" + +syn sync linebreaks=1 +syn match hoonNumber "\d\{1,3\}\%(\.\_s\?\d\{3\}\)*" +syn match hoonNumber "0x\x\{1,4\}\%(\.\_s*\x\{4\}\)*" +syn match hoonNumber "0b[01]\{1,4\}\%(\.\_s*[01\.]\{4\}\)*" " comments From 7823c0ef4106451ca2c2f7cc5d63ffc99beb57cd Mon Sep 17 00:00:00 2001 From: Philip Monk Date: Mon, 30 Sep 2013 17:45:18 -0700 Subject: [PATCH 5/5] Improved rune matching to correctly digraphs following tis. --- syntax/hoon.vim | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/syntax/hoon.vim b/syntax/hoon.vim index 3a8bc3399..e1154bee9 100644 --- a/syntax/hoon.vim +++ b/syntax/hoon.vim @@ -34,9 +34,8 @@ syn match hoonSymbolDec "\w*" contained contains=hoonName " numbers " As I understand it, numbers may be in decimal, hex, or binary, and they may " contain dots (functioning merely as separators, as in the American comma). -" XXX It appears that a number can span lines if (and only if?) the lines end -" in a dot. This mostly causes issues with hex numbers across mulitple lines -" (as in hoon.hoon line 3067). +" As I understand it, numbers may be in decimal, hex, or binary, and they may +" contain dots (optionally followed by whitespace), as in the German manner. syn sync linebreaks=1 syn match hoonNumber "\d\{1,3\}\%(\.\_s\?\d\{3\}\)*" @@ -55,6 +54,7 @@ syn region hoonString start=+'+ skip=+\\[\\']+ end=+'+ contains=@spe " match digraphs " XXX digraphs starting with '=' in e.g. paramater naming when this is really " the monograph '=' followed by a digraph. Example: hoon.hoon line 218 +" This is now fixed when '= is followed by a digraph, but not when followed by a monograph " XXX we should match some of the monographs, I'm just not totally sure which " ones. Certainly, $ and ~ seem important, but I'm not sure of others. @@ -136,15 +136,15 @@ syn match hoonRune ";;" syn match hoonRune ";\*" syn match hoonRune ";=" syn match hoonRune ";?" -syn match hoonRune "=|" -syn match hoonRune "=\." -syn match hoonRune "=\^" -syn match hoonRune "=:" +syn match hoonRune "=|\ze[^-|_%:.^+\=?]" +syn match hoonRune "=\.\ze[^+*=?^]" +syn match hoonRune "=\^\ze[^-+|.&~=?]" +syn match hoonRune "=:\ze[^-_~/^+~*]" syn match hoonRune "=<" syn match hoonRune "=>" syn match hoonRune "=-" syn match hoonRune "=+" -syn match hoonRune "=\~" +syn match hoonRune "=\~\ze[^|\%:/<>#\+&=!]" syn match hoonRune "?|" syn match hoonRune "?:" syn match hoonRune "?\."