Skip to content

Commit

Permalink
make indent checking more strict
Browse files Browse the repository at this point in the history
  • Loading branch information
robertmuth committed Nov 4, 2024
1 parent dc2c01e commit 6fd4eb5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion FE/LangTest/edit_distance_test.cw
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ fun edit_distance(a span(u8), b span(u8), tmp span!(uint)) uint:

fun main(argc s32, argv ^^u8) s32:
ref let! v = [MAX_LEN]uint{}
test::AssertEq#(edit_distance("", "", v), 0_uint)
test::AssertEq#(edit_distance("", "", v), 0_uint)
test::AssertEq#(edit_distance(TEST_STRING, TEST_STRING, v), 0_uint)
test::AssertEq#(edit_distance("", "abc", v), 3_uint)
test::AssertEq#(edit_distance("abc", "", v), 3_uint)
Expand Down
2 changes: 2 additions & 0 deletions FE/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -1024,6 +1024,8 @@ def _ParseStatementList(inp: Lexer, outer_indent: int):
tk = inp.peek()
if tk.column < indent:
break
if tk.column != indent:
cwast.CompilerError(tk.srcloc, "Bad indent")
stmt = _ParseStatement(inp)
logger.info("STATEMENT: %s", stmt)
out.append(stmt)
Expand Down

0 comments on commit 6fd4eb5

Please sign in to comment.