1
0
mirror of https://github.com/janet-lang/janet synced 2025-10-28 06:07:43 +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:
Calvin Rose
2018-12-13 18:46:53 -05:00
parent 4b01409d2d
commit e8c0dcd14e
16 changed files with 400 additions and 187 deletions

View File

@@ -125,10 +125,10 @@ int32_t janet_verify(JanetFuncDef *def) {
for (i = 0; i < def->bytecode_length; i++) {
uint32_t instr = def->bytecode[i];
/* Check for invalid instructions */
if ((instr & 0xFF) >= JOP_INSTRUCTION_COUNT) {
if ((instr & 0x7F) >= JOP_INSTRUCTION_COUNT) {
return 3;
}
enum JanetInstructionType type = janet_instructions[instr & 0xFF];
enum JanetInstructionType type = janet_instructions[instr & 0x7F];
switch (type) {
case JINT_0:
continue;