support typedef forward declarations

This commit is contained in:
Zachary Snow 2019-09-04 23:41:24 -04:00
parent 1a6e0ce9df
commit ad0db916cc
1 changed files with 5 additions and 0 deletions

View File

@ -736,6 +736,11 @@ NonDeclPackageItem :: { [PackageItem] }
| "import" PackageImportItems ";" { map (uncurry Import) $2 }
| "export" PackageImportItems ";" { map (Export . Just) $2 }
| "export" "*" "::" "*" ";" { [Export Nothing] } -- "Nothing" being no restrictions
| ForwardTypedef ";" { $1 }
ForwardTypedef :: { [PackageItem] }
: "typedef" "enum" Identifier { [] }
| "typedef" "struct" Identifier { [] }
| "typedef" "union" Identifier { [] }
PackageImportItems :: { [(Identifier, Maybe Identifier)] }
: PackageImportItem { [$1] }