Merge MVP features #1

Merged
dominic merged 16 commits from prototype into master 2026-04-24 18:48:16 +00:00
Showing only changes of commit c93864c7e4 - Show all commits

View File

@ -192,7 +192,6 @@ namespace XNeedle.Parser
from c1 in Comment.SingleLineComment.Optional() from c1 in Comment.SingleLineComment.Optional()
from bang in Parse.Char('!') from bang in Parse.Char('!')
from name in Parse.AnyChar.Until(Parse.Char('(')) from name in Parse.AnyChar.Until(Parse.Char('('))
from bopen in Parse.Char('(')
from arguments in Argument.DelimitedBy(Parse.Char(',').Token()) from arguments in Argument.DelimitedBy(Parse.Char(',').Token())
from bclose in Parse.Char(')') from bclose in Parse.Char(')')
let ctx = new Context{XPathSelector = "//*."} let ctx = new Context{XPathSelector = "//*."}
@ -200,7 +199,10 @@ namespace XNeedle.Parser
from open in Parse.Char('{') from open in Parse.Char('{')
from ws2 in Parse.WhiteSpace.Many().Optional() from ws2 in Parse.WhiteSpace.Many().Optional()
from c2 in Comment.SingleLineComment.Optional() from c2 in Comment.SingleLineComment.Optional()
from expressions in ExprPart(ctx).Or<Part>(Parse.Ref(() => RuleObject)).Or<Part>(Parse.Ref(() => BangObject)).DelimitedBy(Parse.Char(';').Token()) from expressions in Parse.Ref(() => BangObject)
.Or(Parse.Ref(() => RuleObject))
.Or(ExprPart(ctx).Select(e => (Part)e))
.DelimitedBy(Parse.Char(';').Token())
from tailingsemi in Parse.Char(';').Optional() from tailingsemi in Parse.Char(';').Optional()
from ws3 in Parse.WhiteSpace.Many().Optional() from ws3 in Parse.WhiteSpace.Many().Optional()
from close in Parse.Char('}') from close in Parse.Char('}')
@ -214,10 +216,14 @@ namespace XNeedle.Parser
from open in Parse.Char('{') from open in Parse.Char('{')
from ws2 in Parse.WhiteSpace.Many().Optional() from ws2 in Parse.WhiteSpace.Many().Optional()
from c2 in Comment.SingleLineComment.Optional() from c2 in Comment.SingleLineComment.Optional()
from expressions in ExprPart(ctx).Or<Part>(Parse.Ref(() => RuleObject)).Or<Part>(Parse.Ref(() => BangObject)).DelimitedBy(Parse.Char(';').Token()) from expressions in Parse.Ref(() => BangObject)
.Or(Parse.Ref(() => RuleObject))
.Or(ExprPart(ctx).Select(e => (Part)e))
.DelimitedBy(Parse.Char(';').Token())
from tailingsemi in Parse.Char(';').Optional() from tailingsemi in Parse.Char(';').Optional()
from ws3 in Parse.WhiteSpace.Many().Optional() from ws3 in Parse.WhiteSpace.Many().Optional()
from close in Parse.Char('}') from close in Parse.Char('}')
select new Rule{XPathSelector = selector, Body = expressions}; select new Rule{XPathSelector = selector, Body = expressions};
} }
} }