Jump to content

WeiDU Highlighters for Text Editors


Azazello

Recommended Posts

It won't catch many syntax errors (like a missing tilde or THEN), but it will help with misspelled commands--the absence of color is usually a good sign that I've got a typo. Outside of that, having stuff like BEGIN and END highlighted also help in troubleshooting flaky loops.

Link to comment

Is there anyway to highlight BEGIN..END blocks to ensure they are bracketed properly -- apart from simply using indenting. There's one mod that I had corrected of this, after very painfully eyeballing, but if had so many sublevels that I just guessed by putting an END at the, er, end.

Link to comment

No particular reason; they are all configurable, too. And easy to swap or change or add things, just by resorting the various keywords. This particular set of colors was most useful to me, but I still would love stuff more laid out by function (like in the BAF version of some of these, all "triggers" are green, all "actions" are red, all structural code is blue, so when you scan the file and see something not matching the pattermn, *that* is where you have gotten a SetGlobal where your Global call was - id's copy/paste errors rapidly.)

 

I strongly suggest the Crimson and TextPad stuff; ConTEXT is awesome, but it bogs down under multiple or large files. And you can use WinMerge for file comparisons - the only reason I still use ConTEXT is the ability to change to column-wise editing.

 

One day I will have all these sorted better by function, but only when I truly understand OUTER_INNER_PATCH ...

 

could be awhile. Or, hopefuly, someone else will resort them, so they match actions with structiral code!

 

As far as getting them to recognize code template forms, i have not been successful. I am still researching how to do that, looking at the behaviors of other highlighters versus their definitions and keyword files, but I have not figured out how to get them to recognize that while

 

CHAIN IF WEIGHT #-4 ~%BGT_VAR% Global("X#DYQJournalTalk","GLOBAL",1)~ THEN ~%DYNAHEIR_JOINED%~ X#DYQ01
@1
END
++ @2 DO ~SetGlobal("X#DYQJournalTalk","GLOBAL",2)~ EXIT
++ @3 DO ~SetGlobal("X#DYQJournalTalk","GLOBAL",2)~ EXIT
++ @4 DO ~SetGlobal("X#DYQJournalTalk","GLOBAL",2)~ EXIT

is valid, but

IF CHAIN ~%BGT_VAR% Global("X#DYQJournalTalk","GLOBAL",1)~ WEIGHT #-4 X#DYQ01 THEN ~%DYNAHEIR_JOINED%~ 
@1
++  DO ~SetGlobal("X#DYQJournalTalk","GLOBAL",2)~ @2 EXIT
++ DO @3  ~SetGlobal("X#DYQJournalTalk","GLOBAL",2)~ EXIT
@4 ++  DO EXIT ~SetGlobal("X#DYQJournalTalk","GLOBAL",2)~ 
END

is not.

 

That may take a serious programmer, looking at the way program language sepecific highlighters are programmed, to make happen.

 

 

Gotta say - the highlighters to track down misspellings of dvs and minor edit stuff (Like ActionOveride("dv",EscapeArea() )when looking at code, followed up by a full directory and subdirectory regexp search for part of the global you are looking for trouble with, followed by jumping to the file by simply clicking on the line, then opening WindEdit and replacing all specific instances in all files in all directories, then comparison to the original using WinMerge to detect ifthere were unwanted changes (just in case your regexp was wrong), followed by a quick archive - heck, it almost makes you feel like a real programmer. Plus, you don't have errors creep in, always a problem on the huge projects with a zillion files.

 

 

/edit - you can tell by my post that I actually *needed* to put these together, as I type with both thumbs and my forehead. I think I will leave the typos alone in th eabove post, so you can see what I mean... ;)

Link to comment
That may take a serious programmer, looking at the way program language sepecific highlighters are programmed, to make happen.

Well, you'd need to re-implement the parsers (= the .mly files) to get syntax highlighting (as opposed to lexicon highlighting). As you can see given the size of the files (and the fact that .d must call .baf and .tp2 must call .d and .baf, not to mention multiple "entry points" and whatnot), I'd say good luck with that ;)

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...