Module: TSJSON::TokenKind

Defined in:
lib/language/lexer/token_kind.rb

Constant Summary collapse

SOF =
'<SOF>'
EOF =
'<EOF>'
AMP =
'&'
PIPE =
'|'
PAREN_L =
'('
PAREN_R =
')'
BRACKET_L =
'['
BRACKET_R =
']'
BRACE_L =
'{'
BRACE_R =
'}'
CHEVRON_L =
'<'
CHEVRON_R =
'>'
COLON =
':'
SEMICOLON =
';'
EQUALS =
'='
COMMA =
','
DOT =
'.'
QUESTION_MARK =
'?'
NAME =
'Name'
INT =
'Int'
FLOAT =
'Float'
STRING =
'String'
BLOCK_STRING =
'BlockString'
COMMENT =
'Comment'

Class Method Summary collapse

Class Method Details

.operation_precedence(kind) ⇒ Object



28
29
30
31
32
33
34
35
# File 'lib/language/lexer/token_kind.rb', line 28

def self.operation_precedence(kind)
  case (kind)
  when TokenKind::AMP
    return 2
  when TokenKind::PIPE
    return 1
  end
end