mirror of
https://github.com/janet-lang/janet
synced 2026-11-26 08:57:12 +00:00
Make source mapping use byte offset instead of line and col
for better debugging support in repl. Add debug module for better debugging support.
This commit is contained in:
1 parent
4b01409d2d
commit
e8c0dcd14e
16 files changed
+400
-187
No files matched your search
@@ -204,6 +204,8 @@ extern "C" {
|
||||
|
||||
/* Names of all of the types */
|
||||
extern const char *const janet_type_names[16];
|
||||
extern const char *const janet_signal_names[14];
|
||||
extern const char *const janet_status_names[16];
|
||||
|
||||
/* Fiber signals */
|
||||
typedef enum {
|
||||
@@ -667,8 +669,8 @@ struct JanetKV {
|
||||
|
||||
/* Source mapping structure for a bytecode instruction */
|
||||
struct JanetSourceMapping {
|
||||
int32_t line;
|
||||
int32_t column;
|
||||
int32_t start;
|
||||
int32_t end;
|
||||
};
|
||||
|
||||
/* A function definition. Contains information needed to instantiate closures. */
|
||||
@@ -731,8 +733,7 @@ struct JanetParser {
|
||||
size_t statecap;
|
||||
size_t bufcount;
|
||||
size_t bufcap;
|
||||
size_t line;
|
||||
size_t col;
|
||||
size_t offset;
|
||||
int lookback;
|
||||
};
|
||||
|
||||
@@ -967,8 +968,8 @@ JANET_API int janet_buffer_push_u64(JanetBuffer *buffer, uint64_t x);
|
||||
#define janet_tuple_raw(t) ((int32_t *)(t) - 4)
|
||||
#define janet_tuple_length(t) (janet_tuple_raw(t)[0])
|
||||
#define janet_tuple_hash(t) ((janet_tuple_raw(t)[1]))
|
||||
#define janet_tuple_sm_line(t) ((janet_tuple_raw(t)[2]))
|
||||
#define janet_tuple_sm_col(t) ((janet_tuple_raw(t)[3]))
|
||||
#define janet_tuple_sm_start(t) ((janet_tuple_raw(t)[2]))
|
||||
#define janet_tuple_sm_end(t) ((janet_tuple_raw(t)[3]))
|
||||
JANET_API Janet *janet_tuple_begin(int32_t length);
|
||||
JANET_API const Janet *janet_tuple_end(Janet *tuple);
|
||||
JANET_API const Janet *janet_tuple_n(const Janet *values, int32_t n);
|
||||
|
||||
Reference in new issue
Block a user