lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Robert Raschke wrote:

On Sun, Feb 7, 2010 at 6:18 PM, Eike Decker wrote:

    I don't think this is as easy as it looks at first
    what about these cases if whitespaces would not be required:

This thread reminds me of the great quote:

Consistently separating words by spaces became a general custom about the
tenth century A.D., and lasted until about 1957, when FORTRAN abandoned
the practice.
    Sun FORTRAN Reference Manual

Ah, those numerical recipes without spaces and without comments... :-)

Weijers has a point, the Lua implementation doesn't follow a textbook implementation, perhaps some parser/lexer errors can be more helpful, blah blah blah. But Lua makes a lot of engineering trade-offs -- llex.c is a very small lexer. So I think there is nothing wrong with either views -- they involve different priorities.

The other thing about Decker's examples is that, I've done +2000 lines of test cases for Perl highlighting in Scintilla, but I don't recall ever seeing any sort of cunning real-world code that involve digits and dots and breaks highlighting. IMHO such bits would rarely come up in the real world.

If an expression is not instantly decipherable by a human at a glance (that is, instantly parsed, not necessarily instantly understood), well then that's just asking for trouble...

Modern coders use editors with good syntax highlighting and so they likely would only be able to write those cunning bits of code by ignoring highlighting. I wonder if anyone still edits code without colour syntax highlighting...

Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia