mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 23:28:48 +00:00
tabs for indentation
This commit is contained in:
@@ -39,10 +39,10 @@ collect_package :: proc(path: string) -> (pkg: ^ast.Package, success: bool) {
|
|||||||
delete(fullpath)
|
delete(fullpath)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if strings.trim_space(string(src)) == "" {
|
if strings.trim_space(string(src)) == "" {
|
||||||
delete(fullpath)
|
delete(fullpath)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
file := ast.new(ast.File, NO_POS, NO_POS)
|
file := ast.new(ast.File, NO_POS, NO_POS)
|
||||||
file.pkg = pkg
|
file.pkg = pkg
|
||||||
@@ -76,9 +76,9 @@ parse_package :: proc(pkg: ^ast.Package, p: ^Parser = nil) -> bool {
|
|||||||
if !parse_file(p, file) {
|
if !parse_file(p, file) {
|
||||||
ok = false
|
ok = false
|
||||||
}
|
}
|
||||||
if file.pkg_decl == nil {
|
if file.pkg_decl == nil {
|
||||||
error(p, p.curr_tok.pos, "Expected pacakge declaration at the start of the file")
|
error(p, p.curr_tok.pos, "Expected pacakge declaration at the start of the file")
|
||||||
} else if pkg.name == "" {
|
} else if pkg.name == "" {
|
||||||
pkg.name = file.pkg_decl.name
|
pkg.name = file.pkg_decl.name
|
||||||
} else if pkg.name != file.pkg_decl.name {
|
} else if pkg.name != file.pkg_decl.name {
|
||||||
error(p, file.pkg_decl.pos, "different package name, expected '%s', got '%s'", pkg.name, file.pkg_decl.name)
|
error(p, file.pkg_decl.pos, "different package name, expected '%s', got '%s'", pkg.name, file.pkg_decl.name)
|
||||||
|
|||||||
Reference in New Issue
Block a user