Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrectly accepts "anon tag without a value" when the tag has children #12

Closed
Abscissa opened this issue Sep 2, 2014 · 3 comments
Closed

Comments

@Abscissa
Copy link
Collaborator

Abscissa commented Sep 2, 2014

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

If brace appears on it's own line, SDLang-D silently ignores everything inside the curly-braces and does not throw an error:

parent
{
  child1
  child2
}

It should throw an error (like the Java implementation does) because anonymous tags are supposed to require at least one value. Quoting the language guide:

Note: Anonymous tags must have at least one value
Anonymous tags must have one or more values. They cannot contain only attributes. This design decision was taken to avoid confusion between a tag with a single value and an anonymous tag containing only one attribute.

Not allowed: An anonymous tag with a single attribute (and no values)...

size=5

...because it could easily be confused with a tag having a single value

size 5

@Abscissa
Copy link
Collaborator Author

Abscissa commented Sep 2, 2014

Fixed via fab64ea and 1888146

@Abscissa
Copy link
Collaborator Author

Abscissa commented Sep 2, 2014

@marler8997: You may want to know: The fix for this involved a slight change to the grammar in the parser's comments. Specifically, to the <Root> and <TagTerminator> nonterminals.

@marler8997
Copy link

Thanks for letting me know and thanks for fixing these issues so quickly. Daniel was on vacation last week so hopefully he gets back to me today. I have a few pending emails to him about some of the cases from issue 9 (and the whitespace issues for namespaces and attributes). I'll let you know what I find out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants