class Merlin::Context(IdentT, NodeT)
- Merlin::Context(IdentT, NodeT)
- Reference
- Object
Defined in:
context/context.crcontext/modifying.cr
context/querying.cr
Constructors
Instance Method Summary
- #[](key : IdentT | Nil) : Context(IdentT, NodeT)
- #[]?(key : IdentT | Nil) : Context(IdentT, NodeT) | Nil
- #absorb(key : IdentT | Nil) : Nil
- #add(key : IdentT | Nil, value : Context(IdentT, NodeT), clone : Bool = true) : Nil
- #add(key : IdentT | Nil, value : NodeT | Array(NodeT) | MatchedToken(IdentT) | Array(MatchedToken(IdentT))) : Nil
- #add(values : Array(MatchedToken(IdentT))) : Nil
- #add(values : Array(NodeT)) : Nil
- #add(value : MatchedToken(IdentT)) : Nil
- #add(value : NodeT) : Nil
- #after_last_position : Position
- #after_last_position? : Position | Nil
- #become(key : IdentT | Nil) : Nil
- #become(value : NodeT | MatchedToken(IdentT)) : Nil
- #clear : Nil
- #clone
- #copy_with(name = @name.dup, nodes = @nodes.dup, tokens = @tokens.dup, sub_contexts = @sub_contexts.clone)
- #drop(key : IdentT | Nil, index : Int32) : NodeT | MatchedToken(IdentT) | Nil
- #drop(key : IdentT | Nil) : Context(IdentT, NodeT) | Nil
- #drop_context(key : IdentT | Nil) : Context(IdentT, NodeT) | Nil
- #drop_contexts : Nil
- #drop_nodes : Nil
- #drop_tokens : Nil
- #empty? : Bool
- #first_position : Position
- #first_position? : Position | Nil
- #flatten : Nil
- #last_position : Position
- #last_position? : Position | Nil
- #merge(from : Context(IdentT, NodeT), clone : Bool = true) : Nil
- #name : IdentT | Nil
- #name=(name : IdentT | Nil)
- #name_s : String
- #node(index : Int32 = 0) : NodeT
- #node?(index : Int32 = 0) : NodeT | Nil
- #nodes : Array(NodeT)
- #nodes? : Array(NodeT) | Nil
- #rename(from_key : IdentT | Nil, to_key : IdentT | Nil) : Nil
- #reset(name : IdentT | Nil) : Nil
-
#result : NodeT
Root result
- #subcontext_self(as_key : IdentT = @name.not_nil!) : Nil
- #to_subcontext(key : IdentT | Nil) : Nil
- #token(index : Int32 = 0) : MatchedToken(IdentT)
- #token?(index : Int32 = 0) : MatchedToken(IdentT) | Nil
- #tokens : Array(MatchedToken(IdentT))
- #tokens? : Array(MatchedToken(IdentT)) | Nil
- #unsafe_add(key : IdentT | Nil, value : Context(IdentT, NodeT)) : Nil
- #unsafe_merge(from : Context(IdentT, NodeT))
Constructor Detail
def self.new(name : IdentT | Nil, nodes : Array(NodeT) | Nil = nil, tokens : Array(MatchedToken(IdentT)) | Nil = nil, sub_contexts : Hash(IdentT, Context(IdentT, NodeT)) | Nil = nil)
#
Instance Method Detail
def add(key : IdentT | Nil, value : NodeT | Array(NodeT) | MatchedToken(IdentT) | Array(MatchedToken(IdentT))) : Nil
#
def copy_with(name = @name.dup, nodes = @nodes.dup, tokens = @tokens.dup, sub_contexts = @sub_contexts.clone)
#