module Cosmo::Keywords

Defined in:

cosmo/syntax/lexer/keywords.cr

Constant Summary

CLASS_VISIBILITY_KEYWORDS = ["protected", "static"]
KEYWORDS = {"and" => Syntax::And, "or" => Syntax::Or, "not" => Syntax::Not, "true" => Syntax::Boolean, "false" => Syntax::Boolean, "none" => Syntax::None, "fn" => Syntax::Function, "if" => Syntax::If, "unless" => Syntax::Unless, "in" => Syntax::In, "of" => Syntax::Of, "is" => Syntax::Is, "as" => Syntax::As, "else" => Syntax::Else, "every" => Syntax::Every, "while" => Syntax::While, "until" => Syntax::Until, "break" => Syntax::Break, "next" => Syntax::Next, "use" => Syntax::Use, "from" => Syntax::From, "case" => Syntax::Case, "when" => Syntax::When, "mut" => Syntax::Mut, "return" => Syntax::Return, "throw" => Syntax::Throw, "try" => Syntax::Try, "catch" => Syntax::Catch, "finally" => Syntax::Finally, "class" => Syntax::Class, "mixin" => Syntax::Mixin, "new" => Syntax::New, "enum" => Syntax::Enum}
TYPE_KEYWORDS = ["type", "any", "bool", "string", "char", "int", "uint", "bigint", "float", "void", "Function"]

These cannot be any of the keywords above

Class Method Summary

Class Method Detail

def self.class_visibility?(s : String) #

Returns whether or not s is a class vibility keyword


[View source]
def self.get_syntax(s : String) : Syntax #

Returns the syntax type of s if it is a regular keyword


[View source]
def self.keyword?(s : String) #

Returns whether or not s is a regular keyword


[View source]
def self.type?(s : String) #

Returns whether or not s is a type keyword


[View source]