- for no in _need_before_epsilons do
- # Epsilon production that starts the current non-epsilon production
- #var startl = n.location
- no.location = new Location(startl.file, startl.line_start, startl.line_start, startl.column_start, startl.column_start)
- end
- _need_before_epsilons.clear
-
- for no in _need_after_epsilons do
- # Epsilon production that finishes the current non-epsilon production
- #var endl = n.location
- no.location = new Location(endl.file, endl.line_end, endl.line_end, endl.column_end, endl.column_end)
+ if not _need_after_epsilons.is_empty then
+ var loc = new Location(endl.file, endl.line_end, endl.line_end, endl.column_end, endl.column_end)
+ for no in _need_after_epsilons do
+ # Epsilon production that finishes the current non-epsilon production
+ no.location = loc
+ end
+ _need_after_epsilons.clear