polserver/pol-core/bscript/compiler/model
Kevin Eady ddc1b5d26b
Add Escript support for uninitialized class functions (#808)
* update grammar

* AST nodes and test

* Address self-review comments
- Replace `super` comment with something more explanatory
- Rename `make_user_function`

* add class analysis for uninit functions

* fix ast test after disallowing static uninit funcs

* use std::ranges::find_if

* add tests

* use SUPER constant; add test

* Remove unreachable code leftover from #809

Since #809, the super function is only generated for a class when
registering a parent class, and therefore it will always have a body. A
"No base class defines a constructor" will only occur if super was never
generated, and is handled in the "No function linked through
FunctionResolver" section of semantic analyzer.

* Address review comments
- use std::ranges::move instead of move iterators
- use std::is_same_v<> vs std::is_same<>::value
- use switch vs chained ternary conditionals

* update escript guide, create tests that are in escript guide

* add core-changes

* Error on uninit and defined constructor

* Move methods' FunctionLink construction to builder

This allows the error message for the uninit function to have a "See
Also" that point to the defined function.

* Move error checks for uninit and defined functions

These semantic checks should be in the ... SemanticAnalyzer.

* fix typo in core-changes
2025-09-05 23:23:59 +02:00
..
ClassLink.cpp Add super() function call for constructors (#694) 2024-10-10 18:06:04 +02:00
ClassLink.h Add super() function call for constructors (#694) 2024-10-10 18:06:04 +02:00
CompilerWorkspace.cpp Add classinst.function member; Add is binary operator; Add funcref MTH_NEW (#701) 2024-10-10 18:06:04 +02:00
CompilerWorkspace.h Add classinst.function member; Add is binary operator; Add funcref MTH_NEW (#701) 2024-10-10 18:06:04 +02:00
FlowControlLabel.cpp Support function reference calls with default parameters (#710) 2024-10-10 18:06:04 +02:00
FlowControlLabel.h Support function reference calls with default parameters (#710) 2024-10-10 18:06:04 +02:00
FunctionLink.cpp Changes to default construction and base-class semantic analysis (#693) 2024-10-10 18:06:04 +02:00
FunctionLink.h Changes to default construction and base-class semantic analysis (#693) 2024-10-10 18:06:04 +02:00
LocalVariableScopeInfo.h Consolidate local variable scope information (#301) 2020-09-12 09:31:52 -07:00
ScopableName.cpp Changes to default construction and base-class semantic analysis (#693) 2024-10-10 18:06:04 +02:00
ScopableName.h Changes to default construction and base-class semantic analysis (#693) 2024-10-10 18:06:04 +02:00
ScopeName.cpp Fix generated function (constructor, super) registration (#809) 2025-09-04 17:37:40 +00:00
ScopeName.h Fix generated function (constructor, super) registration (#809) 2025-09-04 17:37:40 +00:00
SimpleTypes.h Add compiler support for function expressions (#671) 2024-07-29 22:30:52 +02:00
UserFunctionInclusion.h Use new compiler (when configured) for compile_inc (#303) 2020-09-13 00:41:45 -07:00
UserFunctionType.h Add Escript support for uninitialized class functions (#808) 2025-09-05 23:23:59 +02:00
Variable.cpp Add compiler support for function expressions (#671) 2024-07-29 22:30:52 +02:00
Variable.h Add compiler support for function expressions (#671) 2024-07-29 22:30:52 +02:00
VariableScope.h Add compiler support for function expressions (#671) 2024-07-29 22:30:52 +02:00
WarnOn.h Compiler rewrite: add global variables (#241) 2020-08-25 00:57:03 -07:00