mirror of
https://github.com/polserver/polserver
synced 2026-08-13 08:23:08 -04:00
* Grammar updates - Make class parameters required * Add ClassLink; wip with `super()` calls in ctors * More AST nodes as ScopableNames - (function call) Argument - FunctionParameterDeclaration * Add support for ambiguity handling * Add few more tests * Handle returns in constructors - Semantic analysis to error on returning a value - Introduce specific emitter method for returning from constructor - Various tests * Refactor super building to pre-semantic analysis * Adding several tests, some are TODO - found an issue with function resolver and funcrefs, fix later * Address self-review comments * Fix funcref global func references, tests
15 lines
259 B
Text
15 lines
259 B
Text
class BaseClass()
|
|
function BaseClass( this, arg0 )
|
|
this.base := arg0;
|
|
endfunction
|
|
endclass
|
|
|
|
class Foo( BaseClass )
|
|
function Foo( this, arg0 )
|
|
super( "bar" );
|
|
this.child := arg0;
|
|
endfunction
|
|
endclass
|
|
|
|
var obj := Foo( "foo" );
|
|
print( obj );
|