rlwhitcomb / utilities

Some of my personal utility programs
MIT License
2 stars 0 forks source link

Add an "enum" type to Calc #621

Closed rlwhitcomb closed 1 year ago

rlwhitcomb commented 1 year ago

This is just a shorthand for defining symbolic constants.

Syntax:

enum id [ '=' INT ] ( ',' id [ '=' INT ] ) *

Without the "INT" values they start at one and increment by one. Each separate "enum" declaration starts the count over. Whenever an "INT" value is specified, the updating count starts from there and increments by one until and unless another "INT" occurs. The symbols are defined in the current symbol context (block, function, or global).

rlwhitcomb commented 1 year ago

Actually, starting at 1 is non-standard, and all the tests are failing because of "e_lib" (since ALLCAPS is 1, not zero as is documented).