Skip to content

Commit

Permalink
Add more checks for unnamed tag types
Browse files Browse the repository at this point in the history
  • Loading branch information
Gnimuc committed Apr 9, 2024
1 parent 271eedb commit 8652cd4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/generator/top_level.jl
Expand Up @@ -89,7 +89,7 @@ function collect_top_level_nodes!(nodes::Vector{ExprNode}, cursor::CLStructDecl,

str = spelling(cursor)

if isempty(str)
if isempty(str) || occursin(__ANONYMOUS_MARKER, str) || occursin(__UNNAMED_MARKER, str)
@assert isCursorDefinition(cursor)
ty = StructAnonymous()
id = use_deterministic_sym ? gensym_deterministic("Ctag") : gensym("Ctag")
Expand All @@ -114,7 +114,7 @@ function collect_top_level_nodes!(nodes::Vector{ExprNode}, cursor::CLUnionDecl,

str = spelling(cursor)

if isempty(str)
if isempty(str) || occursin(__ANONYMOUS_MARKER, str) || occursin(__UNNAMED_MARKER, str)
@assert isCursorDefinition(cursor)
ty = UnionAnonymous()
id = use_deterministic_sym ? gensym_deterministic("Ctag") : gensym("Ctag")
Expand All @@ -139,7 +139,7 @@ function collect_top_level_nodes!(nodes::Vector{ExprNode}, cursor::CLEnumDecl, o

str = spelling(cursor)

if isempty(str)
if isempty(str) || occursin(__ANONYMOUS_MARKER, str) || occursin(__UNNAMED_MARKER, str)
@assert isCursorDefinition(cursor)
ty = EnumAnonymous()
id = use_deterministic_sym ? gensym_deterministic("Ctag") : gensym("Ctag")
Expand Down

0 comments on commit 8652cd4

Please sign in to comment.