Skip to content

Commit e8e5607

Browse files
committed
parser: Fix whitespace offset with semicolon errors
1 parent ed37eab commit e8e5607

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fusion/core/parser.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ defs.err = function(pos, char, ctx)
6262
end
6363

6464
defs.semicolon = function(pos)
65+
pos = current_file:sub(1, pos - 1):match("()%s-$")
6566
local line = 1
6667
local start = 1
6768
local line_start = 0
@@ -111,7 +112,7 @@ local pattern = re.compile([[
111112
function_call /
112113
return /
113114
{| {:type: 'break' :} |}
114-
) (';' / {} -> semicolon) ws / (
115+
) (';' / {} -> semicolon) / (
115116
statement_block /
116117
while_loop /
117118
numeric_for_loop /

0 commit comments

Comments
 (0)