fix scanner level error reporting in Plex/Errors.py
authorStefan Behnel <scoder@users.berlios.de>
Thu, 21 Apr 2011 18:58:17 +0000 (20:58 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Thu, 21 Apr 2011 18:58:17 +0000 (20:58 +0200)
Cython/Plex/Errors.py
Cython/Plex/Scanners.py

index 965e8d3517c989f2b383412b63b194be709a993f..891873b56feba2f951cd3ac0c97488eb7af1725a 100644 (file)
@@ -39,7 +39,7 @@ class UnrecognizedInput(PlexError):
 
   def __init__(self, scanner, state_name):
     self.scanner = scanner
-    self.position = scanner.position()
+    self.position = scanner.get_position()
     self.state_name = state_name
 
   def __str__(self):
index 36ed9d19c92cf82b6254520f1283f0c00cc9ee20..315742f309de1ad94f6cebbf6e485cd004d62f55 100644 (file)
@@ -299,6 +299,11 @@ class Scanner(object):
     """
     return (self.name, self.start_line, self.start_col)
 
+  def get_position(self):
+    """Python accessible wrapper around position(), only for error reporting.
+    """
+    return self.position()
+
   def begin(self, state_name):
     """Set the current state of the scanner to the named state."""
     self.initial_state = (