package complete

import (
	

	
)

// Reports whether a and b have the same dynamic type. Useful as a more succinct
// alternative to type assertions.
func (,  parse.Node) bool {
	return reflect.TypeOf() == reflect.TypeOf()
}

// Useful as arguments to is.
var (
	aChunk    = &parse.Chunk{}
	aPipeline = &parse.Pipeline{}
	aForm     = &parse.Form{}
	aArray    = &parse.Array{}
	aIndexing = &parse.Indexing{}
	aPrimary  = &parse.Primary{}
	aRedir    = &parse.Redir{}
	aSep      = &parse.Sep{}
)

func ( *parse.Primary,  PureEvaler) (*parse.Compound, string) {
	,  := parent().(*parse.Indexing)
	if ! {
		return nil, ""
	}
	,  := parent().(*parse.Compound)
	if ! {
		return nil, ""
	}
	,  := .PurelyEvalPartialCompound(, .To)
	if ! {
		return nil, ""
	}
	return , 
}

func ( *parse.Form,  string,  int,  PureEvaler) []string {
	// Find out head of the form and preceding arguments.
	// If form.Head is not a simple compound, head will be "", just what we want.
	,  := .PurelyEvalPartialCompound(.Head, -1)
	 := []string{}
	for ,  := range .Args {
		if .Range().From >=  {
			break
		}
		if ,  := .PurelyEvalCompound();  {
			// TODO(xiaq): Arguments that are not simple compounds are simply ignored.
			 = append(, )
		}
	}

	 = append(, )
	return 
}