Skip to content

Commit

Permalink
Correctly read files that include a 'replace' directive
Browse files Browse the repository at this point in the history
- Closes simos#23
- This commit only fixes the Exception occurring when reading a file
  that contains a 'replace' directive. However it does nothing to
  actually process it!
  Therefore another commit is necessary to actually handle 'replace' (in
  addition to 'override').
  • Loading branch information
hupfdule committed Dec 6, 2018
1 parent 742101b commit 8afed34
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion XKBGrammar.g
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ tokens
ELEM_VIRTUALMODS;
KEYELEMENTS;
OVERRIDE;
REPLACE;
OVERLAY;
}

Expand Down Expand Up @@ -97,7 +98,7 @@ line_keytype
;

line_key
: OVERRIDE? 'key' '<' NAME '>' '{' keyelements (',' keyelements)* '}'
: (OVERRIDE|REPLACE)? 'key' '<' NAME '>' '{' keyelements (',' keyelements)* '}'
-> ^(TOKEN_KEY OVERRIDE? ^(KEYCODEX NAME) keyelements+)
;

Expand All @@ -120,6 +121,10 @@ override
: 'override'
;

replace
: 'replace'
;

keyelements
: elem_keysyms
| elem_keysymgroup
Expand Down Expand Up @@ -174,6 +179,10 @@ OVERRIDE
: 'override'
;

REPLACE
: 'replace'
;

NAME
: ( 'a'..'z' | 'A'..'Z' | '_' | '0'..'9' | '+' | '-' )*
;
Expand Down

0 comments on commit 8afed34

Please sign in to comment.