mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 15:18:49 +00:00
Allow core:odin to parse @(require) import
This commit is contained in:
@@ -513,6 +513,7 @@ Package_Decl :: struct {
|
|||||||
Import_Decl :: struct {
|
Import_Decl :: struct {
|
||||||
using node: Decl,
|
using node: Decl,
|
||||||
docs: ^Comment_Group,
|
docs: ^Comment_Group,
|
||||||
|
attributes: [dynamic]^Attribute, // dynamic as parsing will add to them lazily
|
||||||
is_using: bool,
|
is_using: bool,
|
||||||
import_tok: tokenizer.Token,
|
import_tok: tokenizer.Token,
|
||||||
name: tokenizer.Token,
|
name: tokenizer.Token,
|
||||||
|
|||||||
@@ -1103,6 +1103,9 @@ parse_attribute :: proc(p: ^Parser, tok: tokenizer.Token, open_kind, close_kind:
|
|||||||
case ^ast.Foreign_Import_Decl:
|
case ^ast.Foreign_Import_Decl:
|
||||||
if d.docs == nil { d.docs = docs }
|
if d.docs == nil { d.docs = docs }
|
||||||
append(&d.attributes, attribute)
|
append(&d.attributes, attribute)
|
||||||
|
case ^ast.Import_Decl:
|
||||||
|
if d.docs == nil { d.docs = docs }
|
||||||
|
append(&d.attributes, attribute)
|
||||||
case:
|
case:
|
||||||
error(p, decl.pos, "expected a value or foreign declaration after an attribute")
|
error(p, decl.pos, "expected a value or foreign declaration after an attribute")
|
||||||
free(attribute)
|
free(attribute)
|
||||||
|
|||||||
Reference in New Issue
Block a user