Releases: fjl/geas
Releases Β· fjl/geas
v0.3.0
This release brings significant improvements to the expression language, as well as the ability to insert arbitrary bytes into the assembler's bytecode output.
Language
- The new
#bytesdirective inserts raw bytes into the output. - There is also a way to "name"
#bytes, which allow expressions to reference the length and output offset of the inserted bytes. - Values used by expression language computations now keep track of leading zero bytes.
- Operator precedence has been changed to match Go. This is a backwards-incompatible change, which could lead to expressions being evaluated differently. Previously, operator precedence was C-like, with an ordering of multiplication > addition > bit-shifts > logic. The new precedence is simpler with only two levels:
* / % & << >>(multiplication/and/shift) bind stronger than+ - | ^(addition/or). - Unary minus is now supported in expressions.
- Escape sequences
\n,\r,\t,\\,\",\xFFcan be used in strings. - Dotted labels (i.e. labels without JUMPDEST) can now be accessed without the dot. This change is meant to make source text look less intimidating. No backwards-compatibility issues can result from this, since dotted and non-dotted labels share a namespace.
- Similarly, it is now possible to call builtin macros without writing the dot prefix, i.e. you can write
abs(-1)instead of.abs(-1). - Builtin macros
bitlen(),bytelen()have been renamed tointbits()andlen(). Their legacy equivalents are still present, but will produce a deprecation warning when used. - The
#assembledirective has been deprecated in favor of a newassemble()builtin expression macro. You can useassemble()in combination with#bytesto do what#assembledid.
Disassembler
- Invalid opcodes are printed as
#bytesinstead of erroring. - When disassembling with logical blocks, terminating instructions (
STOPetc.) are treated as a block separator.
Targets
- Geas now supports EVM opcodes added by in the Tron network (#19)
v0.2.2
v0.2.1
v0.2.0
This release has some language changes and new compiler features.
Go 1.23 or later is required to build this version.
Macro definition language change
Expresssion macro definitions must now contain an equals sign (=) before the body expresssion.
New definition syntax:
#define macro1 = 1
#define macro2(a) = (100 + $a) / b
Note the old syntax without '=' is still accepted, but produces a warning.
EVM target
You can now declare the EVM version the program should be compiled for.
Use the #pragma target directive to change the target instruction set.
#pragma target "berlin"
All past forks up to "prague" are supported.
Other changes in this release
- Binary operator precedence is now implemented.
- Unused label detection: geas will now warn you about labels which are defined but never used.
- Unreachable code detection: a warning will also be issued for code that can never be reached
by the EVM, e.g. instructions after JUMP or STOP.