The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
- Use linked list for variables, replacing vector
- Use linked list for operators, replacing vector. Ensure we don't over-reserve space when new operators are added.
- Make sure we copy current stack reference with the object itself
- Context error position is now relative to the start of the input string
- Assignment operator now able to handle moved values
- Faster parsing for strings without escape sequences
- Rework internal token buffering
- Support escaped
\n
,\t
,\r
,\xFF
in strings used in expressions position
member of the context'serror
object, which will be set by rpn_process()- For floats in expressions, either integral or fractional part can be omitted when equal to 0. But, not both at the same time.
- Add
i
andu
suffix for integral numbers in expressions, changing default type from Float to Integer or Unsigned respectively - Add
rpn_value::checkedToInt()
,rpn_value::checkedToFloat()
andrpn_value::checkedToUint()
that return error when conversion fails - Add
inf
andnan
operators
- Preserve variable reference after
ifn
- Allow negative offsets for
index
- rpnlib_util.h is included automatically
eq
will try to compare floating point numbers by comparing values distance with type's epsilon
- Parser no longer uses fuzzy matching for built-ins, avoiding conflict with operators
- Parser no longer uses fuzzy matching for numbers written in scientific notation
- Parser accepts more characters as end of the token, in addition to the space (
\n
), carriage return (\r
), horizontal tab (\t
), vertical tab (\v
) - Fix incorrect casts between int / uint / float when calculating numeric limits
p
operator to print the top of the stack via debug function&var
syntax to create variable reference in expression=
operator for variable assignment in expressionexists
operator to check for variable existance (only for references)deref
operator to convert variable reference into a value (only for references)- Allow to use either float or double as floating type, parse numbers in expressions as specified type
- Add boolean type, parse
true
andfalse
in expressions - Add null type, parse
null
in expressions - Add string type, parse double-quoted
"string"
in expressions - Add integer and unsigned integer type, used in operators
- Allow to configure underlying types from rpnlib_config.h and -D... flags
- Return
rpn_error
from operators, split error types into categories - Create a new stack by using
[
keyword. Move stack contents into the previous stack + size by using]
.
- Stack structure no longer holds raw
float
, but internalrpn_value
type - rpn_... setter and getter methods use
rpn_value
type - Operator functions return
rpn_error
type, allowing to return both value and operator errors - Variables in expressions are no longer required to exist when using
&var
Expression will automatically create the variable, set it tonull
and push it's reference on the stack - It is possible to create 'reference' stack values
- Improve precision of
e
andpi
- Proper value for
e
constant - Allow to use multiple contexts simultaniously, replace
rpn_error
andrpn_debug_callback
with the currentrpn_context
memberserror
anddebug_callback
respectively
- Added abs operator
- Change compare operators to eq, ne, gt, ge, lt, le
- rpn_process will (optionally) fail if variable does not exist
- rpn_variable_set will replace value if variable already exists
- Clear context and memory leak fix
- Added more comparison operators (cmp, cmp3, index, map, constrain)
- Added casting methods (round, ceil, floor)
- AUnit testing
- Keywords file
- Do not compile with advanced math support by default
- Renamed 'if' to 'ifn' (numeric if)
- Remote testing using Travis and PIO Plus
- Examples and more commmands
- Renamed 'rpn_begin' to 'rpn_init'
- Variables now start with $ sign
Initial version