Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

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