Annotations

SmallDragon currently supports a few simple Annotations which allow for additional Errors, Warnings and Notes to be issued without adding syntax bloat.

New Annotations can easily be added and existing ones can be disabled with minimal code changes in the transpiler.

Supported Annotations

Example

@private
struct A {
	@private 
	uint32 b;
	
	uint32 a;
}
	
fn main () ~> int {
	subr1();
	subr2();
	return 0;
}

@deprecated  //should cause warning (usage in main)
fn subr1() ~> bool {
	return true;
}

@halts  //should cause warning (infinite loop)
fn subr2() -> bool {
	while(true){ }
	return true;
}