summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-12-07 13:51:23 +0000
committerAndrew Tridgell <tridge@samba.org>2003-12-07 13:51:23 +0000
commitdbf4b65d49f2ac0e99aa4ebf60bb062911012e43 (patch)
tree7f71f6fc44b8a75a46a69ddf6af6e8457985d003
parent4e1bac41f4b89afee79dc9d9165e70e2f4cbb940 (diff)
downloadsamba-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)
-rw-r--r--source4/build/pidl/idl.yp12
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)//) {