diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-05-29 16:14:53 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-05-29 16:15:10 -0700 |
| commit | 3573dfe9950d7037dfc3c48c6486d432100e6866 (patch) | |
| tree | bf320c63545eb6ad51609585271568b05e14fe99 /code_obj.moon | |
| parent | e17822d1e548f96952efb95c64c69704fdfeaf76 (diff) | |
Almost-working reimplementation of source code mapping.
Diffstat (limited to 'code_obj.moon')
| -rw-r--r-- | code_obj.moon | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/code_obj.moon b/code_obj.moon index e821b7e..17ec816 100644 --- a/code_obj.moon +++ b/code_obj.moon @@ -6,6 +6,7 @@ export LINE_STARTS Source = immutable {"filename","start","stop"}, { name:"Source" __new: (filename, start, stop)=> + assert(type(filename) == 'string') if not start start, stop = 1, #FILE_CACHE[filename] if stop and start > stop+1 then error("Invalid range: #{start}, #{stop}") @@ -71,7 +72,7 @@ class Code @append(...) if type(@source) == 'string' @source = Source\from_string(@source) - assert(@source) + assert(@source and Source\is_instance(@source)) append: (...)=> n = select("#",...) |
