- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 11 for OpPos (0.05 sec)
-
src/cmd/compile/internal/types2/const.go
// arbitrarily large. func (check *Checker) overflow(x *operand, opPos syntax.Pos) { assert(x.mode == constant_) if x.val.Kind() == constant.Unknown { // TODO(gri) We should report exactly what went wrong. At the // moment we don't have the (go/constant) API for that. // See also TODO in go/constant/value.go. check.error(atPos(opPos), InvalidConstVal, "constant result is not representable") return }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Feb 22 19:32:17 UTC 2024 - 7.5K bytes - Viewed (0) -
src/go/types/const.go
// arbitrarily large. func (check *Checker) overflow(x *operand, opPos token.Pos) { assert(x.mode == constant_) if x.val.Kind() == constant.Unknown { // TODO(gri) We should report exactly what went wrong. At the // moment we don't have the (go/constant) API for that. // See also TODO in go/constant/value.go. check.error(atPos(opPos), InvalidConstVal, "constant result is not representable") return }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Apr 03 18:48:38 UTC 2024 - 7.6K bytes - Viewed (0) -
src/go/types/expr.go
} // x is a constant so xval != nil and it must be of Int kind. x.val = constant.Shift(xval, op, uint(s)) x.expr = e opPos := x.Pos() if b, _ := e.(*ast.BinaryExpr); b != nil { opPos = b.OpPos } check.overflow(x, opPos) return } // non-constant shift with constant lhs if isUntyped(x.typ) { // spec: "If the left operand of a non-constant shift
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 29 02:09:54 UTC 2024 - 49.7K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/tools/go/ast/astutil/enclosing.go
tok(n.TokPos, len(n.Tok.String()))) case *ast.BasicLit: children = append(children, tok(n.ValuePos, len(n.Value))) case *ast.BinaryExpr: children = append(children, tok(n.OpPos, len(n.Op.String()))) case *ast.BlockStmt: children = append(children, tok(n.Lbrace, len("{")), tok(n.Rbrace, len("}"))) case *ast.BranchStmt: children = append(children,
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Dec 18 21:28:13 UTC 2023 - 15.9K bytes - Viewed (0) -
src/cmd/compile/internal/types2/expr.go
return false } } else { check.errorf(x, InvalidSyntaxTree, "unknown operator %s", op) return false } return true } // opPos returns the position of the operator if x is an operation; // otherwise it returns the start position of x. func opPos(x syntax.Expr) syntax.Pos { switch op := x.(type) { case nil: return nopos // don't crash case *syntax.Operation: return op.Pos() default:
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 29 02:09:54 UTC 2024 - 51.7K bytes - Viewed (0) -
src/go/parser/parser.go
for p.tok == token.OR { t := new(ast.BinaryExpr) t.OpPos = p.pos t.Op = token.OR p.next() t.X = x t.Y = p.embeddedTerm() x = t } return x } func (p *parser) embeddedTerm() ast.Expr { if p.trace { defer un(trace(p, "EmbeddedTerm")) } if p.tok == token.TILDE { t := new(ast.UnaryExpr) t.OpPos = p.pos t.Op = token.TILDE p.next()
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Dec 08 20:07:50 UTC 2023 - 72.2K bytes - Viewed (0) -
src/go/ast/ast.go
// Unary "*" expressions are represented via StarExpr nodes. // UnaryExpr struct { OpPos token.Pos // position of Op Op token.Token // operator X Expr // operand } // A BinaryExpr node represents a binary expression. BinaryExpr struct { X Expr // left operand OpPos token.Pos // position of Op Op token.Token // operator Y Expr // right operand }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Mar 28 21:32:41 UTC 2024 - 35.6K bytes - Viewed (0) -
src/go/parser/resolver.go
if len(lhs) > 0 { if n.Tok == token.DEFINE { // Note: we can't exactly match the behavior of object resolution // during the parsing pass here, as it uses the position of the RANGE // token for the RHS OpPos. That information is not contained within // the AST. as := &ast.AssignStmt{ Lhs: lhs, Tok: token.DEFINE, TokPos: n.TokPos,
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Nov 02 12:56:53 UTC 2023 - 15.8K bytes - Viewed (0) -
src/go/printer/nodes.go
p.expr1(x.X, prec, depth+diffPrec(x.X, prec)) if printBlank { p.print(blank) } xline := p.pos.Line // before the operator (it may be on the next line!) yline := p.lineFor(x.Y.Pos()) p.setPos(x.OpPos) p.print(x.Op) if xline != yline && xline > 0 && yline > 0 { // at least one line break, but respect an extra empty line // in the source if p.linebreak(yline, 1, ws, true) > 0 { ws = ignore
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Oct 17 18:53:17 UTC 2023 - 52.6K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/tools/internal/stdlib/manifest.go
{"BasicLit", Type, 0}, {"BasicLit.Kind", Field, 0}, {"BasicLit.Value", Field, 0}, {"BasicLit.ValuePos", Field, 0}, {"BinaryExpr", Type, 0}, {"BinaryExpr.Op", Field, 0}, {"BinaryExpr.OpPos", Field, 0}, {"BinaryExpr.X", Field, 0}, {"BinaryExpr.Y", Field, 0}, {"BlockStmt", Type, 0}, {"BlockStmt.Lbrace", Field, 0}, {"BlockStmt.List", Field, 0}, {"BlockStmt.Rbrace", Field, 0},
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Apr 02 02:20:05 UTC 2024 - 534.2K bytes - Viewed (0)