feat: resolve file-local import namespaces
This commit is contained in:
@@ -160,6 +160,14 @@ scan proc(
|
||||
cursor += width
|
||||
continue
|
||||
}
|
||||
if (char == '.') {
|
||||
try add_token(state, Token{
|
||||
span = make_span(source, cursor, cursor + 1),
|
||||
kind = .dot,
|
||||
})
|
||||
cursor += 1
|
||||
continue
|
||||
}
|
||||
|
||||
if char == ':' {
|
||||
if cursor + 1 < program.len and program[cursor + 1] == ':' {
|
||||
|
||||
@@ -112,7 +112,7 @@ scans_ranges_without_consuming_float_dots test {
|
||||
expected [19]TokenKind :: [
|
||||
.int, .range, .int, .int, .range_inclusive, .int,
|
||||
.float, .range, .float, .pipe, .at, .ident, .comma, .ident, .pipe,
|
||||
.range, .invalid, .invalid, .eof,
|
||||
.range, .dot, .invalid, .eof,
|
||||
]
|
||||
try testing.expect_equal(expected.len, state.tokens.items.len)
|
||||
for (expected) |kind, index| try testing.expect_equal(kind, state.tokens.items[index].kind)
|
||||
@@ -120,7 +120,7 @@ scans_ranges_without_consuming_float_dots test {
|
||||
try testing.expect_equal(u32(3), state.tokens.items[1].span.end)
|
||||
try testing.expect_equal(u32(7), state.tokens.items[4].span.start)
|
||||
try testing.expect_equal(u32(10), state.tokens.items[4].span.end)
|
||||
try testing.expect_equal(2, diagnostics.count(&diagnostic_store))
|
||||
try testing.expect_equal(1, diagnostics.count(&diagnostic_store))
|
||||
}
|
||||
|
||||
scans_array_delimiters_and_mut_keyword test {
|
||||
|
||||
@@ -59,7 +59,7 @@ TokenKind :: enum {
|
||||
open_bracket, close_bracket
|
||||
open_curly, close_curly
|
||||
|
||||
comma
|
||||
comma, dot
|
||||
colon
|
||||
newline
|
||||
|
||||
|
||||
Reference in New Issue
Block a user