Skip to content

Commit

Permalink
Add missing typedef factory method
Browse files Browse the repository at this point in the history
  • Loading branch information
cogu committed Aug 28, 2023
1 parent 48ce725 commit 2ba40df
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/cfile/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,17 @@ def variable(self,
"""
return core.Variable(name, data_type, const, pointer, extern, static, array)

def typedef(self,
name: str,
data_type: str | core.Type,
const: bool = False, # Only used as pointer qualifier
pointer: bool = False,
array: int | None = None) -> None:
"""
New typedef
"""
return core.TypeDef(name, data_type, const, pointer, array)

def statement(self, expression: Any) -> core.Statement:
"""
New statement
Expand Down

0 comments on commit 2ba40df

Please sign in to comment.