Open
Description
Dear developers,
Is there a way to pass the current line and column of the file being parsed to the action of a rule?
For example:
the grammar:
parameter = (word:w -> AnAction('parameter',str(w),line,column) )
the python file:
def AnAction(name, value, line, column):
print(value +' ' + str(line) + ' ' + str(column))
the input text:
hello this is
a test
the output:
hello 1 1
this 1 7
is 1 12
a 2 1
test 2 3
I'm trying to build a compiler and I would like to check if a variable is already defined. So to make an error message it would be nice if Parsley would provide me with the location of the variable, even when the file has the correct syntax.
Thanks in advance!!!
Metadata
Assignees
Labels
No labels