dlang-community/SDLang-D

Incorrectly accepts ":tagname" (blank namespace, tagname prefixed with colon)

Abscissa opened this issue · 3 comments

This is dedicated ticket for "case 8" in Issue #9:

SDLang-D silently ignores all of these and does not throw an error. Currently this is invalid SDL, but it may become valid in SDLv2 as a way of escaping keywords as tag-names (and possibly attribute names).

:my-tag
:another-tag :still-doesnt-work
:yet-another;:and-another
:null :0

SDLang-D should follow the original Java lib's behavior of prohibiting this. SDLv2 can be dealt with as a separate matter once it's formalized and/or released.

I don't think this is incorrect behaviour.

If the official SDL page can be considered normative, if a tag has no explicit namespace, the namespace defaults to an empty string. This implies that a zero-length namespace is valid.

Hmm, maybe SDLang-D used to silently accept ":tagname" but if so, it doesn't anymore.

However, the error message could be improved. Currently it says "Error: Expected end-of-file, not :", which is confusing.

Closing as "Works fine for me now". However, I did make a note here that we may want to allow this in a v2 of the spec.