File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 4747 (nullable? #'e )]
4848 [_ (raise-syntax-error #f "not a core peg form " this-syntax)]))
4949
50+ ;; MB note: I thought it might be a problem to raise an error when reaching a previously
51+ ;; entered nt, because we might record it as entered when checking one nonterminal and then
52+ ;; enter it again for another. But it's okay because if we check it successfully, then it's in
53+ ;; def-nullable? and we get 'nullable or 'not-nullable instead.
5054(define (nullable-nonterminal? id)
51- (case (or (symbol-table-ref def-nullable? id (lambda () #f )) (symbol-table-ref entered id (lambda () #f )) 'unvisited )
55+ (case (or (symbol-table-ref def-nullable? id #f )
56+ (symbol-table-ref entered id #f )
57+ 'unvisited )
5258 [(nullable) #t ]
5359 [(not-nullable) #f ]
5460 [(entered) (raise-syntax-error #f "left recursion through nonterminal " id)]
You can’t perform that action at this time.
0 commit comments