AAVSO / VStar

VStar is a visualisation and analysis tool for variable star data brought to you by AAVSO
https://www.aavso.org/vstar
GNU Affero General Public License v3.0
10 stars 3 forks source link

Simple numeric expression containing only literals yields error #441

Closed dbenn closed 1 month ago

dbenn commented 1 month ago

The following:

f(n:real) : real { 12.0 }

f(4)

yields:

Cannot invoke "org.aavso.tools.vstar.vela.Operation.ordinal()" because the return value of "org.aavso.tools.vstar.vela.AST.getOp()" is null

when 12.0 should be returned.

Notes

dbenn commented 1 month ago

Note that such literal-only expressions will have been the subject of constant folding so that at execution time, no operator will be present in the AST, which is consistent with the error.