#{ EnumEntry ::= Identifier [ = ConstExpr ] Enum1 ::= 'enum' Identifier '{' EnumEntry { ',' EnumEntry } '}' Enum2 ::= 'enum' Identifier '{' EnumEntry { ';' EnumEntry } '}' Enum ::= Enum1 | Enum2 EnumType1 ::= 'enum' '<' EnumEntry { ',' EnumEntry } '>' EnumType2 ::= 'enum' '<' EnumEntry { ';' EnumEntry } '>' EnumType ::= EnumType1 | EnumType2 #} type Bool = enum @[test()] io.writeln( Bool::False ) io.writeln( Bool.True ) @[test()] @[test()] $False(0) $True(1) @[test()] @[test()] switch( Bool.False ){ case Bool::False : io.writeln( "Bool::False" ) case Bool::True : io.writeln( "Bool::True" ) } @[test()] @[test()] Bool::False @[test()] @[test()] switch( (Bool) $True ){ case Bool::False : io.writeln( "Bool::False" ) case Bool::True : io.writeln( "Bool::True" ) } @[test()] @[test()] Bool::True @[test()] @[test()] bl : Bool = $True io.writeln( bl ) @[test()] @[test()] $True(1) @[test()] @[test()] a = True; @[test()] @[test()] {{ERROR}} .* {{At line}} .* {{Symbol not defined}} @[test()] @[test()] flag = Bool.False + Bool.True @[test()] @[test()] {{not combinable enum}} @[test()] @[test()] type E = enum @[test()] @[test()] {{ERROR}} .* {{At line}} .* {{Invalid type form}} @[test()] @[test()] type E = enum @[test()] @[test()] {{ERROR}} .* {{At line}} .* {{Invalid type form}} @[test()] @[test()] type E = enum @[test()] @[test()] {{ERROR}} .* {{At line}} .* {{Invalid type form}} @[test()] @[test()] type E = enum @[test()] @[test()] {{ERROR}} .* {{At line}} .* {{Value was used}} @[test()] @[test()] type E = enum; var m: map = {->}; m[$x] = true; io.writeln( m[$x] ) @[test()] @[test()] true @[test()]