diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-09-14 19:17:09 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-09-14 19:17:16 -0700 |
| commit | e22c35681f90740b4f5006c30b3f154ebd1f8ea2 (patch) | |
| tree | c7f04d968bade120ebf75cfa0b9f073602917122 /nomsu_compiler.moon | |
| parent | 7112af7cb6ee52f4ef9664db9c03db52d8c73ac9 (diff) | |
Auto-upgraded everything.
Diffstat (limited to 'nomsu_compiler.moon')
| -rw-r--r-- | nomsu_compiler.moon | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/nomsu_compiler.moon b/nomsu_compiler.moon index b6faba3..432a195 100644 --- a/nomsu_compiler.moon +++ b/nomsu_compiler.moon @@ -112,15 +112,14 @@ with NomsuCompiler find_errors(v) errs = [err for err in coroutine.wrap(-> find_errors(tree))] - if #errs > 4 - num_errs = #errs - errs = [errs[i] for i=1,3] - table.insert(errs, "\027[31;1m +#{num_errs-#errs} additional errors...\027[0m\n") - if #errs > 0 + num_errs = #errs + if num_errs > 0 err_strings = [pretty_error{ error:t.error, hint:t.hint, source:t\get_source_code! start:t.source.start, stop:t.source.stop - } for t in *errs] + } for i, t in ipairs(errs) when i <= 3] + if num_errs > 3 + table.insert(err_strings, "\027[31;1m +#{num_errs-#errs} additional errors...\027[0m\n") error(table.concat(err_strings, '\n\n'), 0) return tree .can_optimize = -> false |
