summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Nieto Cid <dnietoc@gmail.com>2010-07-20 16:48:28 -0300
committerDiego Nieto Cid <dnietoc@gmail.com>2011-04-08 14:36:18 -0300
commitdd639e8a51c4d986c51c2bb6f8f91b0e2a9306c9 (patch)
treef0d0a30b4ff79c468778e6b613035958164e704e
parent650a8244fcb3a2f7897842d70073a491832b918e (diff)
Add function to read the state of the scanner.
* console-client/xkb/lex.l (scanner_get_current_location): New function. (scanner_get_current_file): Likewise.
-rw-r--r--console-client/xkb/lex.l12
1 files changed, 12 insertions, 0 deletions
diff --git a/console-client/xkb/lex.l b/console-client/xkb/lex.l
index 379ce692..8887e7a5 100644
--- a/console-client/xkb/lex.l
+++ b/console-client/xkb/lex.l
@@ -368,3 +368,15 @@ overlay2 { yylval.val = 2; return OVERLAY; }
fprintf (stderr, "%s:%d: %s\n", filename, lineno, s);
// error_at_line (0, 1, filename, lineno, "foo %d\n", 2);
}
+
+ int
+ scanner_get_current_location()
+ {
+ return lineno;
+ }
+
+ const char*
+ scanner_get_current_file()
+ {
+ return filename;
+ }