Commit graph

7 commits

Author SHA1 Message Date
turleypol
1463b76c7c
Includes are now all relative to pol-core basefolder (#906)
* all except pol

* pol and includes under defines

* something weird has happened

* remove own folder from include searchpath

* fixed remaining, adapted include style for external headers

* missing include
2026-07-25 23:01:18 +02:00
turleypol
c0bfd2f820
Escript Optimizer more types and operator (#794)
* compile time optimization:
int with doubles and strings
doubles with ints and strings
strings with ints and doubles

* bool with other types, more unary ops, float branch optimizer

* more tests
fixed bool to dbl compare

* output cleanup
more tests

* optimize string values in if statements, optimize ternary operator

* optimize elvis, addes missing files, code cleanup

* use array to keep unoptimized if branch in funcexpr tests

* missing include

* better readable testdata

* removed file

* optimize while and dowhile loops if predicate is a compile time known
value

* cleaner variant of loop optimization?

* added ConstantPredicateLoop Node used by the optimizer for constant loop
predicates
optimize repeat until loop
change tests to run the loops more then once to be sure they work
correctly

* test break/continue with label for constant-loop

* docs
2025-07-10 22:32:29 +02:00
Kevin Eady
593cfffb83
Add uninit, true, false keywords to grammar (#596)
* Update grammar

* Update expression handling for uninit

* update existing tests

* Add new tests

* Remove fullpath from escriptgrammar generation comment

* fix tests

* Update eScript guide

* Declare escript version 0x11

* Add core-changes

* Add `true` and `false` to grammar

* true/false implementation

* Fix existing tests

* Add new tests

* Update core changes

* add docs

* Fix BooleanValue::describe_to

* bool optimizations

* optimize uninit

* remove unused var assignments

* Update grammar for case labels for uninit, booleans

* Fix case label handling for uninit, true, false

* Tests

* Fix compiler version display v1.1700000017881393 -> v1.17

* optimize boolean binary operations

* fix unary boolean optimizer

* add boolean, uninit optimizer test

* Use new fmt lib apis

* Fix compiler warning

* really fix warning lol

* Add Executor[Module]::getParam for bools, FindSubstance test
2024-01-20 05:38:25 +01:00
Kevin Eady
0cd9412066
Properly scope the compiler includes to the Bscript folder. (#360) 2021-02-25 16:53:22 +01:00
Eric Swanson
72ae01414c
AST nodes are nouns. (#333)
Renamed:
  - GetMember to MemberAccess
  - SetMember to MemberAssignment
  - SetMemberByOperator to MemberAssignmentByOperator
  - AssignVariableConsume to VariableAssignmentStatement
2020-09-28 08:11:10 -07:00
Eric Swanson
7c98acf558
New compiler: operators on object members (#288)
* Add support: += *= etc on object members
* Add support for post/prefix operators ++ and -- with object members

Adds:
- ast/SetMemberByOperator
2020-09-08 19:57:38 -07:00
Eric Swanson
a77ddd028e
New compiler: Add optimized unary expressions (#244)
Adds:
- UnaryOperator: AST node for unary operators -, ++, --, and so forth
- UnaryOperatorOptimizer: optimizes a unary operator with its operand
  - now integer and float negation, and integer inversion
  - later x[y]++ to a single instruction

Also:
- automatically include basic.em, which includes some parameter defaults like -1.

This allows the compiler to generate output for a hello, world script with the exact same .ecl output as the legacy compiler.
2020-08-26 19:24:47 -07:00