1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-28 19:19:53 +00:00

Add better debug info to amalgamated source.

This commit is contained in:
Calvin Rose 2020-02-27 00:16:54 -06:00
parent 8cb63cebbe
commit 10ec319c32
3 changed files with 5 additions and 3 deletions

View File

@ -105,6 +105,7 @@ int main(int argc, const char **argv) {
fclose(boot_file); fclose(boot_file);
status = janet_dobytes(env, boot_buffer, (int32_t) boot_size, boot_filename, NULL); status = janet_dobytes(env, boot_buffer, (int32_t) boot_size, boot_filename, NULL);
free(boot_buffer);
/* Deinitialize vm */ /* Deinitialize vm */
janet_deinit(); janet_deinit();

View File

@ -2522,7 +2522,8 @@
(defn do-one-flie (defn do-one-flie
[fname] [fname]
(print "\n/* " fname " */\n") (print "\n/* " fname " */")
(print "#line 0 \"" fname "\"\n")
(def source (slurp fname)) (def source (slurp fname))
(print (string/replace-all "\r" "" source))) (print (string/replace-all "\r" "" source)))

View File

@ -681,8 +681,8 @@ JANET_API int janet_checkint(Janet x);
JANET_API int janet_checkint64(Janet x); JANET_API int janet_checkint64(Janet x);
JANET_API int janet_checksize(Janet x); JANET_API int janet_checksize(Janet x);
JANET_API JanetAbstract janet_checkabstract(Janet x, const JanetAbstractType *at); JANET_API JanetAbstract janet_checkabstract(Janet x, const JanetAbstractType *at);
#define janet_checkintrange(x) ((x) == (int32_t)(x)) #define janet_checkintrange(x) ((x) >= INT32_MIN && (x) <= INT32_MAX && (x) == (int32_t)(x))
#define janet_checkint64range(x) ((x) == (int64_t)(x)) #define janet_checkint64range(x) ((x) >= INT64_MIN && (x) <= INT64_MAX && (x) == (int64_t)(x))
#define janet_unwrap_integer(x) ((int32_t) janet_unwrap_number(x)) #define janet_unwrap_integer(x) ((int32_t) janet_unwrap_number(x))
#define janet_wrap_integer(x) janet_wrap_number((int32_t)(x)) #define janet_wrap_integer(x) janet_wrap_number((int32_t)(x))