lua-users home
lua-l archive

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


On Wed, Mar 7, 2012 at 10:32 AM, Sam Roberts <vieuxtech@gmail.com> wrote:
> On Tue, Mar 6, 2012 at 12:38 PM, Eric Wing <ewmailing@gmail.com> wrote:
>> As a counterweight to your DSL example, I recall CMake
>> disliking/rejecting Lua because commas would suddenly be required.
>
> Getting rid of commas in a DSL is pretty doable, implementing an
> EndSection that takes no arguments is harder! :-)
>
> https://gist.github.com/1989745
>
> BeginSection "news"
>  Link "C-programming"
>    href = "etc."
>    title "a book on C"
>
>  Link = "I love lua"
>    href "etc."
>    title = "an essay"
> --EndSection ""
>

If you really wanted an EndSection why not just repeat the section name?

BeginSection "news"
EndSection "news"

A bit verbose, but if you want an EndSection you don't really care
about being terse anyway. :)

You'd get yourself a bit of error checking too, if somebody were to
leave a section unclosed or attempt to close the wrong section.