diff options
author | Li Jin <dragon-fly@qq.com> | 2024-04-25 10:59:47 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2024-04-25 10:59:47 +0800 |
commit | c857b3b83c7485693bfcc2b65e9e6e95107396f4 (patch) | |
tree | d739efe1bfe729c739c44706556396e4b5c094a1 /src | |
parent | ff9dd402cfd0f52138d6951db9479f03da2d9c1f (diff) | |
download | yuescript-c857b3b83c7485693bfcc2b65e9e6e95107396f4.tar.gz yuescript-c857b3b83c7485693bfcc2b65e9e6e95107396f4.tar.bz2 yuescript-c857b3b83c7485693bfcc2b65e9e6e95107396f4.zip |
fix a traceback rewrite issue.
Diffstat (limited to 'src')
-rw-r--r-- | src/yuescript/stacktraceplus.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/yuescript/stacktraceplus.h b/src/yuescript/stacktraceplus.h index 3167ba8..594afb5 100644 --- a/src/yuescript/stacktraceplus.h +++ b/src/yuescript/stacktraceplus.h | |||
@@ -1,6 +1,6 @@ | |||
1 | R"lua_codes( | 1 | R"lua_codes( |
2 | --[[ | 2 | --[[ |
3 | Copyright (c) 2010 Ignacio Burgueño, modified by Li Jin | 3 | Copyright (c) 2010 Ignacio Burgueño, modified by Li Jin, 2024 |
4 | 4 | ||
5 | Permission is hereby granted, free of charge, to any person obtaining a copy | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy |
6 | of this software and associated documentation files (the "Software"), to deal | 6 | of this software and associated documentation files (the "Software"), to deal |
@@ -335,7 +335,7 @@ local function getYueLineNumber(fname, line) | |||
335 | end | 335 | end |
336 | if file_exist then | 336 | if file_exist then |
337 | local codes = yue.read_file(file_path) | 337 | local codes = yue.read_file(file_path) |
338 | local yueFile = codes:match("^%s*--%s*%[.*%]:%s*([^\n]*)") | 338 | local yueFile = codes:match("^%s*%-%-%s*%[[^%]]*%]:%s*([^\n]*)") |
339 | if yueFile then | 339 | if yueFile then |
340 | fname = yueFile:gsub("^%s*(.-)%s*$", "%1") | 340 | fname = yueFile:gsub("^%s*(.-)%s*$", "%1") |
341 | source = codes | 341 | source = codes |
@@ -346,7 +346,7 @@ local function getYueLineNumber(fname, line) | |||
346 | local current, target = 1, tonumber(line) | 346 | local current, target = 1, tonumber(line) |
347 | local findLine = line | 347 | local findLine = line |
348 | for lineCode in source:gmatch("([^\r\n]*)\r?\n?") do | 348 | for lineCode in source:gmatch("([^\r\n]*)\r?\n?") do |
349 | local num = lineCode:match("--%s*(%d+)%s*$") | 349 | local num = lineCode:match("%-%-%s*(%d+)%s*$") |
350 | if num then | 350 | if num then |
351 | findLine = num | 351 | findLine = num |
352 | end | 352 | end |