Skip to content

Commit

Permalink
(#72) CParser: __cli_import should be prioritized
Browse files Browse the repository at this point in the history
  • Loading branch information
ForNeVeR committed Feb 15, 2022
1 parent a166b3a commit 59f3fac
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Cesium.Parser/CParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,12 +208,12 @@ private ParseResult<Declaration> customParseDeclaration(int offset)
var preLastDeclarationSpecifier = declarationSpecifiers[^2];
initDeclaratorList = parseInitDeclaratorList(preLastDeclarationSpecifier.Offset);
if (initDeclaratorList.IsOk)
{
declarationSpecifiers.RemoveAt(declarationSpecifiers.Count - 1);
offset = initDeclaratorList.Ok.Offset;
}
}

if (initDeclaratorList.IsOk)
offset = initDeclaratorList.Ok.Offset;

if (TokenStream.TryLookAhead(offset, out var t) && t.Text == ";")
{
++offset;
Expand All @@ -240,6 +240,7 @@ private static Declaration MakeDeclaration(
private static DeclarationSpecifiers MakeDeclarationSpecifiers(IEnumerable<IDeclarationSpecifier> specifiers) =>
specifiers.ToImmutableArray();

[Rule("declaration_specifier: cli_import_specifier")] // Extension, see CParser.CliExtensions.cs
[Rule("declaration_specifier: storage_class_specifier")]
[Rule("declaration_specifier: type_specifier")]
[Rule("declaration_specifier: type_qualifier")]
Expand Down

0 comments on commit 59f3fac

Please sign in to comment.