class TL1::AST::Literal

A literal string. Not included in parsing output, but must match.

Public Class Methods

new(fields) click to toggle source
# File lib/tl1/ast.rb, line 221
def initialize(fields)
  @fields = fields.to_str
end
parse(source) click to toggle source
# File lib/tl1/ast.rb, line 217
def self.parse(source)
  new(source)
end

Public Instance Methods

format(*) click to toggle source
# File lib/tl1/ast.rb, line 225
def format(*)
  fields
end
parse(source, **) click to toggle source
# File lib/tl1/ast.rb, line 229
def parse(source, **)
  return if source == format
  raise "Message literal does not match format literal #{format.inspect}"
end