diff options
| author | Undecidable Robot <undecidabot@gmail.com> | 2016-06-02 01:27:36 +0800 |
|---|---|---|
| committer | Undecidable Robot <undecidabot@gmail.com> | 2016-06-02 01:30:14 +0800 |
| commit | 98c4afa82ed818fddaafa659eaafebc51f92d3a0 (patch) | |
| tree | a1cbdaa2af220a0c0e8ac8344b9c04041ce2cae8 | |
| parent | 25418397dc509482e8c96decb0e13b4354337efb (diff) | |
| download | lpeglabel-98c4afa82ed818fddaafa659eaafebc51f92d3a0.tar.gz lpeglabel-98c4afa82ed818fddaafa659eaafebc51f92d3a0.tar.bz2 lpeglabel-98c4afa82ed818fddaafa659eaafebc51f92d3a0.zip | |
Moving error to a higher level
| -rw-r--r-- | relabel.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/relabel.lua b/relabel.lua index 6fdbb7c..003a0d2 100644 --- a/relabel.lua +++ b/relabel.lua | |||
| @@ -378,7 +378,7 @@ local function compile (p, defs) | |||
| 378 | if type(cp) == "string" then | 378 | if type(cp) == "string" then |
| 379 | cp = cp:gsub("^[^:]+:[^:]+: ", "") | 379 | cp = cp:gsub("^[^:]+:[^:]+: ", "") |
| 380 | end | 380 | end |
| 381 | error(cp) | 381 | error(cp, 3) |
| 382 | end | 382 | end |
| 383 | if #syntaxerrs > 0 then | 383 | if #syntaxerrs > 0 then |
| 384 | local lines = splitlines(p) | 384 | local lines = splitlines(p) |
| @@ -390,7 +390,7 @@ local function compile (p, defs) | |||
| 390 | tinsert(errors, rep(" ", col-1) .. "^") | 390 | tinsert(errors, rep(" ", col-1) .. "^") |
| 391 | end | 391 | end |
| 392 | syntaxerrs = {} | 392 | syntaxerrs = {} |
| 393 | error("syntax error(s) in pattern\n" .. concat(errors, "\n")) | 393 | error("syntax error(s) in pattern\n" .. concat(errors, "\n"), 3) |
| 394 | end | 394 | end |
| 395 | return cp | 395 | return cp |
| 396 | end | 396 | end |
