summaryrefslogtreecommitdiff
path: root/CHANGES
diff options
context:
space:
mode:
authorDavid Beazley <dave@dabeaz.com>2012-04-19 08:46:40 -0500
committerDavid Beazley <dave@dabeaz.com>2012-04-19 08:46:40 -0500
commit7b14435c128857706572cbf7318d12159071dceb (patch)
tree437908e4c31efa5b79c3c6c99df583d4134f881f /CHANGES
parent19aa4cbddfaa4f776d6899349a09e362d6dbb7b9 (diff)
downloadply-7b14435c128857706572cbf7318d12159071dceb.tar.gz
Enhanced position tracking in errors
Diffstat (limited to 'CHANGES')
-rw-r--r--CHANGES27
1 files changed, 27 insertions, 0 deletions
diff --git a/CHANGES b/CHANGES
index f8a1d1e..99dc683 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,32 @@
Version 3.5
---------------------
+04/19/12: beazley
+ Fixed some problems with line and position tracking and the use of error
+ symbols. If you have a grammar rule involving an error rule like this:
+
+ def p_assignment_bad(p):
+ '''assignment : location EQUALS error SEMI'''
+ ...
+
+ You can now do line and position tracking on the error token. For example:
+
+ def p_assignment_bad(p):
+ '''assignment : location EQUALS error SEMI'''
+ start_line = p.lineno(3)
+ start_pos = p.lexpos(3)
+
+ If the trackng=True option is supplied to parse(), you can additionally get
+ spans:
+
+ def p_assignment_bad(p):
+ '''assignment : location EQUALS error SEMI'''
+ start_line, end_line = p.linespan(3)
+ start_pos, end_pos = p.lexspan(3)
+
+ Note that error handling is still a hairy thing in PLY. This won't work
+ unless your lexer is providing accurate information. Please report bugs.
+ Suggested by a bug reported by Davis Herring.
+
04/18/12: beazley
Change to doc string handling in lex module. Regex patterns are now first
pulled from a function's .regex attribute. If that doesn't exist, then