SPUG: perltidy HTML colorer

Michael R. Wolf MichaelRunningWolf at att.net
Thu Dec 27 09:29:22 CST 2001


Scott Blachowicz <scott at sabami.seaslug.org> writes:

> Except that it DOES get confused by some items, like "here
> scripts" and some of the special $ variables, IIRC.

Unfortunately, Perl is a difficult language to parse.  That
makes it difficult to have tools work correctly.  The syntax
hilighting is only a heuristic.

I know that Damian plans to make a Perl Perl parser next
year.  I expect that once that's available, we should start
to see many tools start to be developed around it -
factoring editors, perltidy act-alikes, cross-references,
etc.  I remember when similar things started creeping up on
the back of the gnu compiler.  I expect that being able to
build on a stable and *accessible* Perl parser will enable
all kinds of neat skunk works projects.

> There are times where I just give up on it and use
> indented-text-mode on some scripts, but it does work on
> most things I've tried to edit with it.

I sometimes rewrite my code to fit different quirks in my
environment.  Mostly, those quirks have to do with business
logic, testability, readability, bugs in a spec, bugs in
another piece of code.  Occassionally, I will rewrite code
around the *editor*.  If there are two ways to do it, I pick
the one that hilights better.  It's usually not a big deal -
add an extra quote in a comment, use qq() instead of single
quotes, add another backslash somewhere, choose different
quoting characters.  Yeah, I know it sounds lame to have the
editor dictate how I code, but as I've already listed, my
code is constrained by a *lot* of outside influences.  If it
were pure *science* I'd refine it out, but balancing all the
influences is the *art* of it.  Think how much cleaner our
science is (computer science) than most other sciences!
Heck, when I read about some sciences, I think that it's
just a collection of exceptions.  Apparently, there are no
absolutes.  At least we've got a few.


Michael


-- 
Michael R. Wolf
    All mammals learn by playing!
       MichaelRunningWolf at att.net


 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
     Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/





More information about the spug-list mailing list