1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-28 01:58:17 +03:00

a bit more speed and better line matching in errors

(This used to be commit 788f6c44dbae48e13c9eeaca3bfa3ac7efbbd4e2)
This commit is contained in:
Andrew Tridgell 2003-12-07 13:51:23 +00:00
parent 4e1bac41f4
commit dbf4b65d49

View File

@ -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)//) {