projects
/
platform
/
upstream
/
nasm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fc565dd
)
tokhash: allow a bit smarter pattern matching
author
H. Peter Anvin
<hpa@zytor.com>
Mon, 24 Sep 2007 17:50:23 +0000
(10:50 -0700)
committer
H. Peter Anvin
<hpa@zytor.com>
Mon, 24 Sep 2007 17:50:23 +0000
(10:50 -0700)
Allow constants to match only part of the token string.
tokhash.pl
patch
|
blob
|
history
diff --git
a/tokhash.pl
b/tokhash.pl
index
a63e55f
..
f45d07d
100755
(executable)
--- a/
tokhash.pl
+++ b/
tokhash.pl
@@
-101,6
+101,18
@@
while (defined($line = <TD>)) {
$tokens{$token} = scalar @tokendata;
$data = $pattern;
+ if ($data =~ /^(.*)\{(.*)\}(.*)$/) {
+ my $head = $1, $tail = $3;
+ my $px = $2;
+
+ $px =~ s/\*/(.*)/g;
+ if ($token =~ /$px/i) {
+ $data = $head."\U$1".$tail;
+ } else {
+ die "$0: token $token doesn't match $px\n";
+ }
+ }
+
$data =~ s/\*/\U$token/g;
push(@tokendata, "\"$token\", $data");