lua-users home
lua-l archive

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


On 11 April 2011 09:36, Fabio Mascarenhas <mascarenhas@acm.org> wrote:
> Hi Henk,
>
> I wrote Luma against a pretty old version of LPEG, 0.7. I have updated
> luma.re to work with LPEG 0.10, forking LPEG's re.lua. The changes are
> simple:
>
> * allow _ as a non-terminal name
> * search for non-terminals in the definitions first (instead of
> requiring definitions to be prepended by %)
>
> These changes make writing and composing grammars much more convenient.
>
> I have put a new rockspec online, and moved the repository to github:
>
> http://github.com/mascarenhas/luma
>
> The test suite passes with the latest versions of LPEG and Cosmo
> installed (there is no luma.cosmo anymore, BTW, it just uses the
> installed Cosmo).

Thanks for making this available! Especially on Github, which makes it
easy to incorporate as a submodule of my own repos.

The convention that I follow with lua libraries as git repos is to put
the library files at the top level, so that the repo can be used
directly as a git-submodule of another git repo, and the .lua files
found transparently by the lua loader.

>From reading the discussion thread, it seems like this is a more
complex issue than it appeared. I have to say that I understand the
desire to use the % prefix for external definitions, but at the same
time _ parses very well for "glob whitespace". It does seem a problem
that the basic rules would shadow local rules, especially for 'name'
which seems natural as a local grammar rule for many macros.

    henk