Commit c487be34 authored by Deucе's avatar Deucе 👌🏾
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 82b99558
......@@ -2396,7 +2396,13 @@ function run_ref(sec, fname)
function check_begin(arg) {
if (arg < args.length && args[arg].toLowerCase() === 'do') {
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 {
// Remove empty arguments from end...
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment