TheToolsmiths / ddl

Data Definition Language for Game Development Tools
MIT License
4 stars 3 forks source link

Type Aliasing #1

Open flaxed opened 5 years ago

flaxed commented 5 years ago

Support type aliasing.

There seems to be two cases for this. The first and most straightforward behaves like most type alias in programming languages. The second is for codegen, when the pipeline wants to map DDL types to specific types it uses.

Example (with ad-hoc syntax):

alias string {
  type = "CString"
}

This feature needs care since it impacts the data model of any library handling the format

leiradel commented 5 years ago

I think this is a codegen choice that shouldn't leak into the DDL syntax. I can for example generate C++ and Javascript code from the same DDL declaration, and ofc CString doesn't mean anything in Javascript.