How to interpret this MultiplicativeOperature rule

18 views
Skip to first unread message

deos...@gmail.com

unread,
Feb 20, 2019, 5:46:56 AM2/20/19
to PEG.js: Parser Generator for JavaScript
Hi,

I assume there is a typo with this the following rule:

--BEGIN-PASTE---

MultiplicativeOperator
= $("*" !"*")
/ $"/"

Multiplicative
= head:Exponentiation
tail:(__ MultiplicativeOperator __ Exponentiation)*
{ log(`Multiplicative (${text()})`); return buildBinaryExpression(head, tail, location(), text(), rule()); }

--END-PASTE-----

If you want the entire context for this, well, it is part of a FEEL parser. Exact line of code is available through the following link:

https://github.com/EdgeVerve/feel/blob/master/grammar/feel.pegjs#L468

Warning: it quite large to digest in one sitting. You can see the same pattern used at an earlier line: https://github.com/EdgeVerve/feel/blob/master/grammar/feel.pegjs#L228

How to properly interpret this?

- Arun

Reply all
Reply to author
Forward
0 new messages