QuoteMatcher [QCtx]
extends ObjectSupertypes
ObjectConstructors
QuoteMatcher
( ) ( implicit qctx: QCtx )Members
Env
= Map[Symbol,Symbol]A map relating equivalent symbols from the scrutinee and the pattern For example in
A map relating equivalent symbols from the scrutinee and the pattern For example in
'{val a = 4; a * a} match case '{ val x = 4; x * x }
when matching a * a
with x * x
the environment will contain Map(a -> x)
.
debug
: [31mfalse[0mqctx
: QCtxcaseMatches
( scrutinee: CaseDef , pattern: CaseDef ) ( implicit x$3: Context , x$4: Env ) : MatchingfoldPatterns
( patterns1: List[Tree] , patterns2: List[Tree] ) ( implicit x$3: Context , x$4: Env ) : ( Env, Matching )matchLists
[T] ( l1: List[T] , l2: List[T] ) ( mtch: (T, T) => Matching ) : MatchingCheck that all trees match with mtch
and concatenate the results with &&
Check that all trees match with mtch
and concatenate the results with &&
patternsMatches
( scrutinee: Tree , pattern: Tree ) ( implicit x$3: Context , x$4: Env ) : ( Env, Matching )Check that the pattern trees match and return the contents from the pattern holes. Return a tuple with the new environment containing the bindings defi...
Check that the pattern trees match and return the contents from the pattern holes. Return a tuple with the new environment containing the bindings defined in this pattern and a matching. The matching is None if the pattern trees do not match otherwise return Some of a tuple containing all the contents in the holes.