Trying to parse a single line conditional where code tries to test the left hand is equal to the right hand.
{
user = {id: 'abc123'}
function_name() {...}
}
if (user.id === 'abc123...') { function_name() }
I've so far looked at these posts PEG-php parsing if statement and How to describe conditional statement (if-then-else) using PEG
PEG syntax is very alien to me, and I'm sure if it's even the right methodology for my needs. Might be overkill.
Currently using peg.js/peggy.js
Your question is very vague, I will try to give you a starting point,
this is a grammar that would consume your example intput.
For the condition part it will produce