enum
Crystal::Keyword
Overview
All possible identifiers that may be considered keywords.
Defined in:
compiler/crystal/syntax/token.crEnum Members
-
ABSTRACT =
0 -
ALIAS =
1 -
ALIGNOF =
2 -
ANNOTATION =
3 -
AS =
4 -
AS_QUESTION =
5 -
ASM =
6 -
BEGIN =
7 -
BREAK =
8 -
CASE =
9 -
CLASS =
10 -
DEF =
11 -
DO =
12 -
ELSE =
13 -
ELSIF =
14 -
END =
15 -
ENSURE =
16 -
ENUM =
17 -
EXTEND =
18 -
FALSE =
19 -
FOR =
20 -
FUN =
21 -
IF =
22 -
IN =
23 -
INCLUDE =
24 -
INSTANCE_ALIGNOF =
25 -
INSTANCE_SIZEOF =
26 -
IS_A_QUESTION =
27 -
LIB =
28 -
MACRO =
29 -
MODULE =
30 -
NEXT =
31 -
NIL =
32 -
NIL_QUESTION =
33 -
OF =
34 -
OFFSETOF =
35 -
OUT =
36 -
POINTEROF =
37 -
PRIVATE =
38 -
PROTECTED =
39 -
REQUIRE =
40 -
RESCUE =
41 -
RESPONDS_TO_QUESTION =
42 -
RETURN =
43 -
SELECT =
44 -
SELF =
45 -
SIZEOF =
46 -
STRUCT =
47 -
SUPER =
48 -
THEN =
49 -
TRUE =
50 -
TYPE =
51 -
TYPEOF =
52 -
UNINITIALIZED =
53 -
UNION =
54 -
UNLESS =
55 -
UNTIL =
56 -
VERBATIM =
57 -
WHEN =
58 -
WHILE =
59 -
WITH =
60 -
YIELD =
61
Instance Method Summary
-
#abstract?
Returns
trueif this enum value equalsABSTRACT -
#alias?
Returns
trueif this enum value equalsALIAS -
#alignof?
Returns
trueif this enum value equalsALIGNOF -
#annotation?
Returns
trueif this enum value equalsANNOTATION -
#as?
Returns
trueif this enum value equalsAS -
#as_question?
Returns
trueif this enum value equalsAS_QUESTION -
#asm?
Returns
trueif this enum value equalsASM -
#begin?
Returns
trueif this enum value equalsBEGIN -
#break?
Returns
trueif this enum value equalsBREAK -
#case?
Returns
trueif this enum value equalsCASE -
#class?
Returns
trueif this enum value equalsCLASS -
#def?
Returns
trueif this enum value equalsDEF -
#do?
Returns
trueif this enum value equalsDO -
#else?
Returns
trueif this enum value equalsELSE -
#elsif?
Returns
trueif this enum value equalsELSIF -
#end?
Returns
trueif this enum value equalsEND -
#ensure?
Returns
trueif this enum value equalsENSURE -
#enum?
Returns
trueif this enum value equalsENUM -
#extend?
Returns
trueif this enum value equalsEXTEND -
#false?
Returns
trueif this enum value equalsFALSE -
#for?
Returns
trueif this enum value equalsFOR -
#fun?
Returns
trueif this enum value equalsFUN -
#if?
Returns
trueif this enum value equalsIF -
#in?
Returns
trueif this enum value equalsIN -
#include?
Returns
trueif this enum value equalsINCLUDE -
#instance_alignof?
Returns
trueif this enum value equalsINSTANCE_ALIGNOF -
#instance_sizeof?
Returns
trueif this enum value equalsINSTANCE_SIZEOF -
#is_a_question?
Returns
trueif this enum value equalsIS_A_QUESTION -
#lib?
Returns
trueif this enum value equalsLIB -
#macro?
Returns
trueif this enum value equalsMACRO -
#module?
Returns
trueif this enum value equalsMODULE -
#next?
Returns
trueif this enum value equalsNEXT -
#nil?
Returns
trueif this enum value equalsNIL -
#nil_question?
Returns
trueif this enum value equalsNIL_QUESTION -
#of?
Returns
trueif this enum value equalsOF -
#offsetof?
Returns
trueif this enum value equalsOFFSETOF -
#out?
Returns
trueif this enum value equalsOUT -
#pointerof?
Returns
trueif this enum value equalsPOINTEROF -
#private?
Returns
trueif this enum value equalsPRIVATE -
#protected?
Returns
trueif this enum value equalsPROTECTED -
#require?
Returns
trueif this enum value equalsREQUIRE -
#rescue?
Returns
trueif this enum value equalsRESCUE -
#responds_to_question?
Returns
trueif this enum value equalsRESPONDS_TO_QUESTION -
#return?
Returns
trueif this enum value equalsRETURN -
#select?
Returns
trueif this enum value equalsSELECT -
#self?
Returns
trueif this enum value equalsSELF -
#sizeof?
Returns
trueif this enum value equalsSIZEOF -
#struct?
Returns
trueif this enum value equalsSTRUCT -
#super?
Returns
trueif this enum value equalsSUPER -
#then?
Returns
trueif this enum value equalsTHEN -
#to_s
Returns a
Stringrepresentation of this enum member. -
#true?
Returns
trueif this enum value equalsTRUE -
#type?
Returns
trueif this enum value equalsTYPE -
#typeof?
Returns
trueif this enum value equalsTYPEOF -
#uninitialized?
Returns
trueif this enum value equalsUNINITIALIZED -
#union?
Returns
trueif this enum value equalsUNION -
#unless?
Returns
trueif this enum value equalsUNLESS -
#until?
Returns
trueif this enum value equalsUNTIL -
#verbatim?
Returns
trueif this enum value equalsVERBATIM -
#when?
Returns
trueif this enum value equalsWHEN -
#while?
Returns
trueif this enum value equalsWHILE -
#with?
Returns
trueif this enum value equalsWITH -
#yield?
Returns
trueif this enum value equalsYIELD
Instance methods inherited from struct Enum
&(other : self) : self
&,
+(other : Int) : self
+,
-(other : Int) : self
-,
<=>(other : self)
<=>,
==(other : self)==(other) ==, ^(other : self) : self ^, |(other : self) : self |, ~ : self ~, clone clone, each(& : self -> ) each, hash(hasher) hash, includes?(other : self) : Bool includes?, inspect(io : IO) : Nil inspect, to_f32 : Float32 to_f32, to_f32! : Float32 to_f32!, to_f64 : Float64 to_f64, to_f64! : Float64 to_f64!, to_i : Int32 to_i, to_i128 : Int128 to_i128, to_i128! : Int128 to_i128!, to_i16 : Int16 to_i16, to_i16! : Int16 to_i16!, to_i32 : Int32 to_i32, to_i32! : Int32 to_i32!, to_i64 : Int64 to_i64, to_i64! : Int64 to_i64!, to_i8 : Int8 to_i8, to_i8! : Int8 to_i8!, to_json(json : JSON::Builder) : Nil to_json, to_s(io : IO) : Nil
to_s : String to_s, to_u128 : UInt128 to_u128, to_u128! : UInt128 to_u128!, to_u16 : UInt16 to_u16, to_u16! : UInt16 to_u16!, to_u32 : UInt32 to_u32, to_u32! : UInt32 to_u32!, to_u64 : UInt64 to_u64, to_u64! : UInt64 to_u64!, to_u8 : UInt8 to_u8, to_u8! : UInt8 to_u8!, to_yaml(yaml : YAML::Nodes::Builder) to_yaml, value : Int value
Constructor methods inherited from struct Enum
from_value(value : Int) : self
from_value,
new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)new(value : self)
new(pull : JSON::PullParser) : self new, parse(string : String) : self parse
Class methods inherited from struct Enum
each(& : self -> )
each,
from_value?(value : Int) : self | Nil
from_value?,
names : Array(String)
names,
parse?(string : String) : self | Nil
parse?,
valid?(value : self) : Bool
valid?,
values : Array(self)
values
Macros inherited from struct Enum
[](*values)
[],
flags(*values)
flags
Instance methods inherited from module Comparable(Enum)
<(other : T) : Bool
<,
<=(other : T)
<=,
<=>(other : T)
<=>,
==(other : T)
==,
>(other : T) : Bool
>,
>=(other : T)
>=,
clamp(min, max)clamp(range : Range) clamp
Instance methods inherited from struct Value
==(other : Log::Metadata::Value)==(other : JSON::Any)
==(other : YAML::Any)
==(other) ==, dup dup
Instance methods inherited from class Object
! : Bool
!,
!=(other)
!=,
!~(other)
!~,
==(other)
==,
===(other : JSON::Any)===(other : YAML::Any)
===(other) ===, =~(other) =~, as(type : Class) as, as?(type : Class) as?, class class, dup dup, hash(hasher)
hash hash, in?(collection : Object) : Bool
in?(*values : Object) : Bool in?, inspect(io : IO) : Nil
inspect : String inspect, is_a?(type : Class) : Bool is_a?, itself itself, nil? : Bool nil?, not_nil!(message)
not_nil! not_nil!, pretty_inspect(width = 79, newline = "\n", indent = 0) : String pretty_inspect, pretty_print(pp : PrettyPrint) : Nil pretty_print, responds_to?(name : Symbol) : Bool responds_to?, tap(&) tap, to_json(io : IO) : Nil
to_json : String to_json, to_pretty_json(indent : String = " ") : String
to_pretty_json(io : IO, indent : String = " ") : Nil to_pretty_json, to_s(io : IO) : Nil
to_s : String to_s, to_yaml(io : IO) : Nil
to_yaml : String to_yaml, try(&) try, unsafe_as(type : T.class) forall T unsafe_as
Class methods inherited from class Object
from_json(string_or_io : String | IO, root : String)from_json(string_or_io : String | IO) from_json, from_yaml(string_or_io : String | IO) from_yaml
Macros inherited from class Object
class_getter(*names, &block)
class_getter,
class_getter!(*names)
class_getter!,
class_getter?(*names, &block)
class_getter?,
class_property(*names, &block)
class_property,
class_property!(*names)
class_property!,
class_property?(*names, &block)
class_property?,
class_setter(*names)
class_setter,
def_clone
def_clone,
def_equals(*fields)
def_equals,
def_equals_and_hash(*fields)
def_equals_and_hash,
def_hash(*fields)
def_hash,
delegate(*methods, to object)
delegate,
forward_missing_to(delegate)
forward_missing_to,
getter(*names, &block)
getter,
getter!(*names)
getter!,
getter?(*names, &block)
getter?,
property(*names, &block)
property,
property!(*names)
property!,
property?(*names, &block)
property?,
setter(*names)
setter
Instance Method Detail
Returns a String representation of this enum member.
In the case of regular enums, this is just the name of the member.
In the case of flag enums, it's the names joined by vertical bars, or "None",
if the value is zero.
If an enum's value doesn't match a member's value, the raw value is returned as a string.
Color::Red.to_s # => "Red"
IOMode::None.to_s # => "None"
(IOMode::Read | IOMode::Write).to_s # => "Read | Write"
Color.new(10).to_s # => "10"