mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 01:48:07 +02:00
script: Use a stack to push/pop recursed line numbers.
Still not entirely helpful in the event of recursive parsing without a reference to the file as well as the line number in the event of an exception.
This commit is contained in:
parent
4b4de940ee
commit
c8a8e57d6a
1 changed files with 6 additions and 2 deletions
|
|
@ -1374,6 +1374,7 @@ csi_status_t
|
|||
_csi_scan_file (csi_t *ctx, csi_file_t *src)
|
||||
{
|
||||
csi_status_t status;
|
||||
int old_line_number;
|
||||
|
||||
/* This function needs to be reentrant to handle recursive scanners.
|
||||
* i.e. one script executes a second.
|
||||
|
|
@ -1384,12 +1385,15 @@ _csi_scan_file (csi_t *ctx, csi_file_t *src)
|
|||
ctx->scanner.depth = 0;
|
||||
return status;
|
||||
}
|
||||
|
||||
ctx->scanner.line_number = 0; /* XXX broken by recursive scanning */
|
||||
}
|
||||
|
||||
old_line_number = ctx->scanner.line_number;
|
||||
ctx->scanner.line_number = 0;
|
||||
|
||||
_scan_file (ctx, src);
|
||||
|
||||
ctx->scanner.line_number = old_line_number;
|
||||
|
||||
--ctx->scanner.depth;
|
||||
return CSI_STATUS_SUCCESS;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue