Skip to content
Snippets Groups Projects
Commit fcb6e1db authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Fix if <condition> then do begin handling.

In various places (most visibly stoneb.txt pawn shop), the following
is used:

@if <condition> then do begin
 @begin

The begin on the @if line must be ignored, and the @begin on the
second line starts the block.
parent 3193874d
No related branches found
No related tags found
No related merge requests found
...@@ -2396,7 +2396,13 @@ function run_ref(sec, fname) ...@@ -2396,7 +2396,13 @@ function run_ref(sec, fname)
function check_begin(arg) { function check_begin(arg) {
if (arg < args.length && args[arg].toLowerCase() === 'do') { if (arg < args.length && args[arg].toLowerCase() === 'do') {
if (args.length > (arg + 1) && args[arg + 1].toLowerCase() === 'begin') { if (args.length > (arg + 1) && args[arg + 1].toLowerCase() === 'begin') {
handlers.begin(args.slice(arg + 2)); // Check next line for @begin
if (line < files[fname].lines.length - 1) {
if (files[fname].lines[line + 1].search(/^\s*@begin/i) === 0) {
line++;
handlers.begin([]);
}
}
} }
else { else {
// Remove empty arguments from end... // Remove empty arguments from end...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment