浏览代码

[cint.c] Fixing error when filing ts

Vinicius Teshima 1 年之前
父节点
当前提交
d4f153f5d6
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/cint.c

+ 3 - 1
src/cint.c

@@ -47,12 +47,14 @@ main(int argc, const char *argv[])
 	str = str_from_cstr(src, src_size);
 
 	l = lexer_create(str);
+	t = lexer_next_token(&l);
 	for ( ; t.typ.code != TT_EOF; t = lexer_next_token(&l) ) {
+		printf("%ld -> %s\n", ts_size, t.typ.name);
 		ts[ts_size++] = t;
 	}
 
 	for ( i = 0; i < ts_size; ++i ) {
-		printf("%d - %s -> `%.*s`\n",
+		printf("%ld, %d - %s -> `%.*s`\n", i,
 		       ts[i].typ.code, ts[i].typ.name, 
 		       (int) ts[i].lit.size, ts[i].lit.data);
 	}