class Opulent::Tokens
@Tokens
Public Class Methods
[](name)
click to toggle source
Return the requested token to the parser
@param name [Symbol] Token requested by the parser accept method
# File lib/opulent/tokens.rb, line 163 def self.[](name) @tokens[name] end
[]=(name, token)
click to toggle source
Set a new token at runtime
@param name [Symboidentifierl] Identifier for the token @param token [Token] Token data to be set
# File lib/opulent/tokens.rb, line 172 def self.[]=(name, token) @tokens[name] = token end
bracket(bracket)
click to toggle source
Return the matching closing bracket
@param bracket [String] Opening bracket for the capture group
# File lib/opulent/tokens.rb, line 150 def self.bracket(bracket) case bracket when '(' then return ')' when '[' then return ']' when '{' then return '}' when '<' then return '>' end end