Skip to content

Conversation

@dantleech
Copy link
Member

Do not crash if no more tokens after supertype declration..

Currently token peek returns the next token and then we get the type of the token, however if you declare a supertype for a node definition but do not define anything after, peek returns null and we get a fatal error when trying to access null as an object.

e.g.

<slinp = "http://slinp.com/ns/1.0">

[slinp:resource] > mix:created, mix:lastModified, nt:base
abstract
+ * (slinp:resource)

[slinp:webFolder] > nt:base
+ root (slinp:resource)

[slinp:root] > nt:base
+ web (slinp:webFolder) = slinp:webFolder autocreated

[slinp:article] > slinp:resource

Would crash the parser.

Do not crash if no more tokens after supertype declration
@dbu
Copy link
Member

dbu commented May 19, 2014

thanks. could you add a test case for this to be sure its fixed and to avoid regression?

build fail is still the performance test.

@dantleech
Copy link
Member Author

There are no existing concrete tests for the CND parser -- I am guessing that it would require a full implementation or extensive mocking?

@dbu
Copy link
Member

dbu commented May 19, 2014

ah ok, then its out of scope for this bugfix. i created #111 about this - if you feel like it, would be awesome.

dbu added a commit that referenced this pull request May 19, 2014
[CND PARSER] Fixed parsing bug
@dbu dbu merged commit 3f4b16f into master May 19, 2014
@dbu dbu deleted the cnd_parser_fix branch May 19, 2014 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants