Skip to content

Instantly share code, notes, and snippets.

@hmarcelodn
Created May 24, 2022 21:19
Show Gist options
  • Select an option

  • Save hmarcelodn/5f1c94493a7ce2bd440a2c29b563bd7a to your computer and use it in GitHub Desktop.

Select an option

Save hmarcelodn/5f1c94493a7ce2bd440a2c29b563bd7a to your computer and use it in GitHub Desktop.
thl-grammar.pegjs-10
AndCondition = head:ConditionStatement tail:(_ '&&' _ ConditionStatement)+ {
const accum = [{...head}];
tail.reduce((accumulated, element) => {
accumulated.push(element[3]);
return accumulated;
}, accum);
return { op: '&&', predicates: accum };
} / ConditionStatement
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment