diff options
author | Andrew Tridgell <tridge@samba.org> | 2003-12-07 13:51:23 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2003-12-07 13:51:23 +0000 |
commit | dbf4b65d49f2ac0e99aa4ebf60bb062911012e43 (patch) | |
tree | 7f71f6fc44b8a75a46a69ddf6af6e8457985d003 /source4/build/pidl | |
parent | 4e1bac41f4b89afee79dc9d9165e70e2f4cbb940 (diff) | |
download | samba-dbf4b65d49f2ac0e99aa4ebf60bb062911012e43.tar.gz samba-dbf4b65d49f2ac0e99aa4ebf60bb062911012e43.tar.bz2 samba-dbf4b65d49f2ac0e99aa4ebf60bb062911012e43.zip |
a bit more speed and better line matching in errors
(This used to be commit 788f6c44dbae48e13c9eeaca3bfa3ac7efbbd4e2)
Diffstat (limited to 'source4/build/pidl')
-rw-r--r-- | source4/build/pidl/idl.yp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/source4/build/pidl/idl.yp b/source4/build/pidl/idl.yp index f780c99662..13f9b05df4 100644 --- a/source4/build/pidl/idl.yp +++ b/source4/build/pidl/idl.yp @@ -247,7 +247,8 @@ sub _Error { print "Syntax error at $file:$line near '$last_token'\n"; } -sub _Lexer { +sub _Lexer($) +{ my($parser)=shift; $parser->YYData->{INPUT} @@ -257,9 +258,12 @@ again: $parser->YYData->{INPUT} =~ s/^[ \t]*//; for ($parser->YYData->{INPUT}) { - if (s/^\# (\d+) \"(.*?)\"( \d+|)//) { - $parser->YYData->{LINE} = $1; - $parser->YYData->{INPUT_FILENAME} = $2; + if (/^\#/) { + if (s/^\# (\d+) \"(.*?)\"( \d+|)//) { + $parser->YYData->{LINE} = $1-1; + $parser->YYData->{INPUT_FILENAME} = $2; + goto again; + } goto again; } if (s/^(\n)//) { |