diff options
author | Michael Stapelberg <stapelberg@users.noreply.github.com> | 2016-11-28 18:20:46 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-28 18:20:46 +0100 |
commit | 633a9f7b1475ffd5c72489bc6bd2d224c441c9a9 (patch) | |
tree | 20cbdabef577ecdaa35d4a4354dfb8aede2ea34f /generate-command-parser.pl | |
parent | f2ffd8d8644c6c663f9da90cff42ac31acdc462e (diff) | |
download | i3-633a9f7b1475ffd5c72489bc6bd2d224c441c9a9.tar.gz i3-633a9f7b1475ffd5c72489bc6bd2d224c441c9a9.zip |
Implement RandR 1.5 support (#2580)
This comes with the intentionally undocumented --disable-randr15 command
line flag and disable-randr15 configuration directive. We will add
documentation before the release if and only if it turns out that users
actually need to use this flag in their setups. Ideally, nobody would
need to use the flag and everything would just keep working, but it’s
better to be safe than sorry.
fixes #1799
Diffstat (limited to 'generate-command-parser.pl')
-rwxr-xr-x | generate-command-parser.pl | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/generate-command-parser.pl b/generate-command-parser.pl index 6208945d..a7687c7b 100755 --- a/generate-command-parser.pl +++ b/generate-command-parser.pl @@ -65,7 +65,7 @@ for my $line (@raw_lines) { my $current_state; for my $line (@lines) { - if (my ($state) = ($line =~ /^state ([A-Z_]+):$/)) { + if (my ($state) = ($line =~ /^state ([A-Z0-9_]+):$/)) { #say "got a new state: $state"; $current_state = $state; } else { @@ -155,12 +155,20 @@ for my $state (@keys) { # to generate a format string. The format uses %d for <number>s, # literal numbers or state IDs and %s for NULL, <string>s and literal # strings. + + # remove the function name temporarily, so that the following + # replacements only apply to the arguments. + my ($funcname) = ($fmt =~ /^(.+)\(/); + $fmt =~ s/^$funcname//; + $fmt =~ s/$_/%d/g for @keys; $fmt =~ s/\$([a-z_]+)/%s/g; $fmt =~ s/\&([a-z_]+)/%ld/g; $fmt =~ s/"([a-z0-9_]+)"/%s/g; $fmt =~ s/(?:-?|\b)[0-9]+\b/%d/g; + $fmt = $funcname . $fmt; + say $callfh " case $call_id:"; say $callfh " result->next_state = $next_state;"; say $callfh '#ifndef TEST_PARSER'; |