summaryrefslogtreecommitdiff
path: root/console-client
diff options
context:
space:
mode:
authorDiego Nieto Cid <dnietoc@gmail.com>2010-07-19 21:26:43 -0300
committerDiego Nieto Cid <dnietoc@gmail.com>2011-04-08 14:36:16 -0300
commitda8c738584a142ca2f34cceed95ff446a97f8d6a (patch)
tree1b18a2ad2502510a21fa15ed86673167fddd72cc /console-client
parentcc562f054ceaceb0e1631d50cec03de3c1a9b853 (diff)
Lexer support for keycodes with +/- symbols and arbitrary level numbers.
Diffstat (limited to 'console-client')
-rw-r--r--console-client/xkb/lex.l3
1 files changed, 2 insertions, 1 deletions
diff --git a/console-client/xkb/lex.l b/console-client/xkb/lex.l
index 37b88c3f..6ef9134c 100644
--- a/console-client/xkb/lex.l
+++ b/console-client/xkb/lex.l
@@ -30,7 +30,7 @@
%option nodebug
%option UNPUT
-KEYCODE "<"[A-Z][A-Z0-9]*">"
+KEYCODE "<"[A-Z][-+A-Z0-9]*">"
DIGIT [0-9]
NUM {DIGIT}{DIGIT}*
FLOAT {DIGIT}{DIGIT}*\.{DIGIT}{DIGIT}*
@@ -91,6 +91,7 @@ level1 { yylval.val = 1; return LEVEL; }
level2 { yylval.val = 2; return LEVEL; }
level3 { yylval.val = 3; return LEVEL; }
level4 { yylval.val = 4; return LEVEL; }
+level[1-9][0-9]* { yylval.val = atoi(yytext + 5); return LEVEL; }
/* Groups. */
group1 { yylval.val = 1; return GROUPNUM; }