From dd639e8a51c4d986c51c2bb6f8f91b0e2a9306c9 Mon Sep 17 00:00:00 2001 From: Diego Nieto Cid Date: Tue, 20 Jul 2010 16:48:28 -0300 Subject: 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. --- console-client/xkb/lex.l | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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; + } -- cgit v1.2.3