• Home
  • Raw
  • Download

Lines Matching refs:ast

203 func (ev *Evaluator) evalAssign(ast *assignAST) error {
205 lhs, rhs, err := ev.evalAssignAST(ast)
213 return ast.errorf("*** empty variable name.")
219 func (ev *Evaluator) evalAssignAST(ast *assignAST) (string, Var, error) {
220 ev.srcpos = ast.srcpos
223 switch v := ast.lhs.(type) {
237 rhs, err := ast.evalRHS(ev, lhs)
263 func (ev *Evaluator) evalMaybeRule(ast *maybeRuleAST) error {
265 ev.srcpos = ast.srcpos
268 glog.Infof("maybe rule %s: %q assign:%v", ev.srcpos, ast.expr, ast.assign)
272 aexpr := toExpr(ast.expr)
274 semi := ast.semi
293 if ast.isRule {
306 if ast.semi != nil {
308 sexpr, _, err := parseExpr(ast.semi, nil, parseOp{})
324 r := &rule{srcpos: ast.srcpos}
326 glog.Infof("rule? %s: %q assign:%v rhs:%s", r.srcpos, line, ast.assign, rhs)
328 assign, err := r.parse(line, ast.assign, rhs)
333 warnNoPrefix(ast.srcpos, "invalid `override' directive")
337 return ast.error(err)
341 …glog.Infof("rule %q assign:%v rhs:%v=> outputs:%q, inputs:%q", ast.expr, ast.assign, rhs, r.output…
369 func (ev *Evaluator) evalCommand(ast *commandAST) error {
370 ev.srcpos = ast.srcpos
374 if strings.IndexByte(ast.cmd, '=') >= 0 {
375 line := trimLeftSpace(ast.cmd)
376 mk, err := parseMakefileString(line, ast.srcpos)
378 return ast.errorf("parse failed: %q: %v", line, err)
391 if strings.TrimSpace(ast.cmd)[0] == '#' {
394 return ast.errorf("*** commands commence before first target.")
396 ev.lastRule.cmds = append(ev.lastRule.cmds, ast.cmd)
398 ev.lastRule.cmdLineno = ast.lineno
485 func (ev *Evaluator) evalInclude(ast *includeAST) error {
487 ev.srcpos = ast.srcpos
489 glog.Infof("%s include %q", ev.srcpos, ast.expr)
490 v, _, err := parseExpr([]byte(ast.expr), nil, parseOp{})
492 return ast.errorf("parse failed: %q: %v", ast.expr, err)
498 return ast.errorf("%v", err)
508 return ast.errorf("glob error: %s: %v", pat, err)
518 …if IgnoreOptionalInclude != "" && ast.op == "-include" && matchPattern(fn, IgnoreOptionalInclude) {
523 if ast.op == "include" {
586 var stmts []ast
601 func (ev *Evaluator) evalExport(ast *exportAST) error {
603 ev.srcpos = ast.srcpos
605 v, _, err := parseExpr(ast.expr, nil, parseOp{})
607 return ast.errorf("failed to parse: %q: %v", string(ast.expr), err)
613 return ast.errorf("%v\n expr:%s", err, v)
615 if ast.hasEqual {
616 ev.exports[string(trimSpaceBytes(buf.Bytes()))] = ast.export
619 ev.exports[string(n)] = ast.export
625 func (ev *Evaluator) evalVpath(ast *vpathAST) error {
627 ev.srcpos = ast.srcpos
631 err := ast.expr.Eval(&ebuf, ev)
633 return ast.errorf("%v\n expr:%s", err, ast.expr)
672 func (ev *Evaluator) eval(stmt ast) error {