mirror of
https://github.com/polserver/polserver
synced 2026-08-13 08:23:08 -04:00
* fix enum classes entries without initializer * docs * update grammar to support scoped identifiers in case labels * add support for enum class constants in case statements * add ScopableName to ConstDeclaration; formatting fixes; tests * update docs
16 lines
354 B
Text
16 lines
354 B
Text
const BAR := 1234;
|
|
|
|
enum class MyEnum
|
|
FOO := 1,
|
|
BAR := MyEnum::FOO * 2, // 1*2 = 2
|
|
BAZ := BAR * 2, // 2*2 = 4
|
|
BLUB := ::BAR, // global BAR, 1234
|
|
BLOB := BAR * ::BAR // global BAR * local bar = 1234 * 2 = 2468
|
|
endenum
|
|
|
|
print( BAR );
|
|
print( MyEnum::FOO );
|
|
print( MyEnum::BAR );
|
|
print( MyEnum::BAZ );
|
|
print( MyEnum::BLUB );
|
|
print( MyEnum::BLOB );
|