Hello,
However when I run the test case on a simple string: "div#hash{background:red;} #someid{padding:1px 1px;}", it returns a GrammarMatch with this ErrorMessage:
Index=57, Context="px 1px;}>>>"
Expected:
S: Repeat: Unary: Alternative
ident: Sequence
element_name: Alternative
hash: Sequence
class: Sequence
attrib: Sequence
pseudo: Sequence
ruleset: Sequence
Suprisingly, Match.Success is true, but I don't believe I should ignore the message. When I print the syntax tree as contained in the match, I get a tree which seems to be correct:
stylesheet - div#hash{background:red;} #someid{padding:1px 1px;}
ruleset - div#hash{background:red;}
selectors - div#hash
selector - div#hash
element_name - div
ident - div
hash - #hash
ident - hash
declarations - background:red;
declaration - background:red
ident - background
expression - red
term - red
ident - red
S -
ruleset - #someid{padding:1px 1px;}
selectors - #someid
selector - #someid
hash - #someid
ident - someid
declarations - padding:1px 1px;
declaration - padding:1px 1px
ident - padding
expression - 1px 1px
term - 1px
number - 1px
operator -
S -
term - 1px
number - 1px
As far as I can tell, the grammar should terminate the match correctly - the top level "stylesheet ::= (ruleset)*" is as simple as it gets and from the error message provided by Eto, it look like it expects another ruleset. I tried adding a newline to the end of the input string, but it didn't help.
Thanks for any assistance