Skip to content

Commit

Permalink
Simplify boolean expression
Browse files Browse the repository at this point in the history
  • Loading branch information
sungshik committed Oct 22, 2024
1 parent c1ededb commit a866514
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 3 additions & 1 deletion rascal-textmate-core/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
target
node_modules
node_modules

src/main/rascal/Scratch.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,9 @@ bool tryParse(Grammar g, Symbol s, str input, bool allowAmbiguity = false) {
}

bool isRecursive(Grammar g, Symbol s, set[Symbol] checking = {})
= s in checking
? true
: any(p <- prodsOf(g, delabel(s)),
/Symbol child := p.symbols,
isRecursive(g, child, checking = checking + s));
= s in checking || any(p <- prodsOf(g, delabel(s)),
/Symbol child := p.symbols,
isRecursive(g, child, checking = checking + s));
@synopsis{
Checks if production `p` is recursive in grammar `g`
Expand Down

0 comments on commit a866514

Please sign in to comment.