jmeaster30 / ocean

A C-like programming language (get it like sea-like like an ocean lol)
GNU General Public License v3.0
0 stars 0 forks source link

Annotation Pass #110

Open jmeaster30 opened 6 months ago

jmeaster30 commented 6 months ago

This pass will go through all the annotations and perform the ast transformations needed (note except for the operator annotations since those must be done during the expression pass)

Function Wrapper annotations

pack/union function generation annotations

pack PackMember { name: string, type: Type, default_value: lazy auto T, # idk }

pack Union { name: string, options: UnionOption[], }

pack UnionOption { name: string,

blah blah blah

}

function pack_generator(pack_object: Pack) -> (code: string); function union_generator(union_object: Union) -> (code: string);


Function argument annotation
- Processes the argument before the function is run

function argument_annotation(value: lazy auto T) -> (result: T)



Tag annotations 
- Can be used on anything and are used for analysis passes
- don't have a function assigned to them as they are kind of outside the language
- things like documentation where a plugin step would go through the ast and generate