On Wed, 13 Mar 2013 06:35:45 +0100
"Kagamin" <[email protected]> wrote:
> 
> As I understand, SDL doesn't support allman style of curly braces?

Correct. This is because tags in SDL are newline-terminated.

(It would be possible to allow it as a special-case, but I want to stay
compatible SDL's official spec and reference implementation, which
doesn't do that.)

You can, however, simulate it with the line-continuation operator:

mytag \
{
    subtag
    subtag
}

But unlike JavaScript (or early versions of Go, IIRC), if you
do use allman-style by mistake, you're guaranteed to get an error
instead of incorrect behavior:

mytag
{
    subtag
    subtag
}

SDLangException:
file.sdl(2:1): Error: Anonymous tags must have at least one value.

Come to think of it, I could probably customize the error message for
that particular situation to say something more appropriate like
"Opening curly braces cannot be on a separate new line".

Reply via email to