瀏覽代碼

fix line number tracking

master
Ian Piumarta 3 月之前
父節點
當前提交
1fd8b2bd7f
共有 2 個檔案被更改,包括 2 行新增4 行删除
  1. +2
    -2
      main.leg
  2. +0
    -2
      test.txt

+ 2
- 2
main.leg 查看文件

@ -1,6 +1,6 @@
# main.leg -- C parser + interpreter # main.leg -- C parser + interpreter
# #
# Last edited: 2025-02-03 10:47:46 by piumarta on xubuntu
# Last edited: 2025-02-03 11:58:41 by piumarta on xubuntu
%{ %{
; ;
@ -1738,7 +1738,7 @@ void startInput(char *name)
void endInput(void) void endInput(void)
{ {
if (List_size(lines)) {
if (lines && List_size(lines)) {
lineNo = _integerValue(List_popLast(lines)); lineNo = _integerValue(List_popLast(lines));
List_popLast(names); List_popLast(names);
} }

+ 0
- 2
test.txt 查看文件

@ -142,8 +142,6 @@ int main(int argc, char **argv)
printf("passed\n"); printf("passed\n");
float f = 42;
return 0; return 0;
} }

Loading…
取消
儲存