Skip to content

Commit aaa8f9c

Browse files
committed
Fix alignment of line numbers
1 parent b4d0a57 commit aaa8f9c

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

error.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ void print_parser_error(FILE* fptr, const char* file_name, char* error_type, con
5757

5858
fprintf(stderr, "--> %s:%u:%u\n", file_name, position.line + 1, position.line_position + 1);
5959

60-
unsigned int chars = calc_chars(position.line);
60+
int chars = calc_chars(position.line + 2);
61+
chars = chars > 1 ? chars : 2;
62+
6163
char start_whitespace[chars];
6264
memset(start_whitespace, ' ', chars);
6365
start_whitespace[chars - 1] = '\0';

examples/binary_increment.tau

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# Implements a simple binary incrementer
22

3-
symbols = 0,1,x
3+
4+
5+
6+
7+
8+
9+
symbols = 0,1,x,_
410
blank = x
511
start = FIND_END
612
end = HALT

0 commit comments

Comments
 (0)