Fix issue parsing vendor/stb/image with the core:odin/parser parser

This commit is contained in:
Brad Lewis
2025-06-18 21:45:15 -04:00
parent 757c243aaf
commit fc58158fb7
2 changed files with 30 additions and 4 deletions
+28
View File
@@ -66,3 +66,31 @@ Foo :: bit_field uint {
ok := parser.parse_file(&p, &file)
testing.expect(t, ok, "bad parse")
}
@test
test_parse_parser :: proc(t: ^testing.T) {
context.allocator = context.temp_allocator
runtime.DEFAULT_TEMP_ALLOCATOR_TEMP_GUARD()
pkg, ok := parser.parse_package_from_path(ODIN_ROOT + "core/odin/parser")
testing.expect(t, ok, "parser.parse_package_from_path failed")
for key, value in pkg.files {
testing.expectf(t, value.syntax_error_count == 0, "%v should contain zero errors", key)
}
}
@test
test_parse_stb_image :: proc(t: ^testing.T) {
context.allocator = context.temp_allocator
runtime.DEFAULT_TEMP_ALLOCATOR_TEMP_GUARD()
pkg, ok := parser.parse_package_from_path(ODIN_ROOT + "vendor/stb/image")
testing.expect(t, ok, "parser.parse_package_from_path failed")
for key, value in pkg.files {
testing.expectf(t, value.syntax_error_count == 0, "%v should contain zero errors", key)
}
}