struct Pars3k::ParseResult(T)

Overview

ParseResult(T) is a result of a parsed Parser with return type T. If the parse errored, then ParseResult(T)#errored will be true. Otherwise, you can get a value of type (T | ParseError) with ParseResult(T).value. If you are absolutely positive the parse did NOT error (e.g. !ParseResult(T).errored), then you can acquire the value of type T with ParseResult(T).definite_value.

Defined in:

pars3k.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(value : T, context : Pars3k::ParseContext) #

[View source]

Class Method Detail

def self.error(message : String, context : ParseContext) #

[View source]
def self.error(e : ParseError) #

[View source]

Instance Method Detail

def context #

[View source]
def definite_error #

[View source]
def definite_value #

[View source]
def error #

[View source]
def errored #

[View source]
def initialize_as_error(e : ParseError) #

[View source]
def set_context_position(pos) #

[View source]
def value #

[View source]