summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
4842059)
Signed-off-by: Jean Privat <jean@pryen.org>
# Already visited epsilon productions that waits something after them
var need_after_epsilons = new Array[Prod]
# Already visited epsilon productions that waits something after them
var need_after_epsilons = new Array[Prod]
- # Location of the last visited token in the current production
- var last_location: nullable Location = null
+ # The last visited token in the current production
+ var last_token: nullable Token = null
redef fun visit(n: ANode)
do
if n isa Token then
if not isset n._location then return
var loc = n._location
redef fun visit(n: ANode)
do
if n isa Token then
if not isset n._location then return
var loc = n._location
# Add a first token to productions that need one
if not _need_first_prods.is_empty then
# Add a first token to productions that need one
if not _need_first_prods.is_empty then
var startl = n._first_location
if startl != null then
# Non-epsilon production
var startl = n._first_location
if startl != null then
# Non-epsilon production
- var endl = _last_location
- assert endl != null
+ var endl = _last_token.location
if startl == endl then
n.location = startl
if startl == endl then
n.location = startl