Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 108 for decls (0.11 sec)

  1. src/go/format/format_test.go

    	wantLit := file.Decls[0].(*ast.GenDecl).Specs[0].(*ast.ValueSpec).Values[0].(*ast.BasicLit)
    	wantVal := wantLit.Value
    
    	var buf bytes.Buffer
    	if err = Node(&buf, fset, file); err != nil {
    		t.Fatal("Node failed:", err)
    	}
    	diff(t, buf.Bytes(), []byte(golden))
    
    	// Check if anything changed after Node returned.
    	gotLit := file.Decls[0].(*ast.GenDecl).Specs[0].(*ast.ValueSpec).Values[0].(*ast.BasicLit)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Feb 20 03:54:46 UTC 2021
    - 4.5K bytes
    - Viewed (0)
  2. src/go/printer/example_test.go

    )
    
    func parseFunc(filename, functionname string) (fun *ast.FuncDecl, fset *token.FileSet) {
    	fset = token.NewFileSet()
    	if file, err := parser.ParseFile(fset, filename, nil, 0); err == nil {
    		for _, d := range file.Decls {
    			if f, ok := d.(*ast.FuncDecl); ok && f.Name.Name == functionname {
    				fun = f
    				return
    			}
    		}
    	}
    	panic("function not found")
    }
    
    func printSelf() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 16 14:55:02 UTC 2022
    - 1.7K bytes
    - Viewed (0)
  3. tensorflow/compiler/mlir/lite/stablehlo/odml_converter/BUILD

        ],
    )
    
    gentbl_cc_library(
        name = "passes_inc_gen",
        compatible_with = get_compatible_with_portable(),
        tbl_outs = [
            (
                [
                    "-gen-pass-decls",
                    "-name=ODMLConverter",
                ],
                "passes.h.inc",
            ),
        ],
        tblgen = "@llvm-project//mlir:mlir-tblgen",
        td_file = "passes.td",
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu May 16 22:27:36 UTC 2024
    - 3.6K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/syntax/nodes_test.go

    // In the snippet, a '@' indicates the position recorded by
    // the parser when creating the respective node.
    type test struct {
    	nodetyp string
    	snippet string
    }
    
    var decls = []test{
    	// The position of declarations is always the
    	// position of the first token of an individual
    	// declaration, independent of grouping.
    	{"ImportDecl", `import @"math"`},
    	{"ImportDecl", `import @mymath "math"`},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Nov 02 18:45:06 UTC 2023
    - 8.7K bytes
    - Viewed (0)
  5. src/cmd/compile/internal/typecheck/mkbuiltin.go

    	var interner typeInterner
    
    	fmt.Fprintf(w, "var %sDecls = [...]struct { name string; tag int; typ int }{\n", name)
    	for _, decl := range f.Decls {
    		switch decl := decl.(type) {
    		case *ast.FuncDecl:
    			if decl.Recv != nil {
    				log.Fatal("methods unsupported")
    			}
    			if decl.Body != nil {
    				log.Fatal("unexpected function body")
    			}
    			fmt.Fprintf(w, "{%q, funcTag, %d},\n", decl.Name.Name, interner.intern(decl.Type))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jan 26 21:56:49 UTC 2023
    - 6K bytes
    - Viewed (0)
  6. src/internal/types/errors/codes_test.go

    		Uses:  make(map[*ast.Ident]Object),
    	}
    	_, err = conf.Check("types", fset, []*ast.File{file}, info)
    	if err != nil {
    		t.Fatal(err)
    	}
    	for _, decl := range file.Decls {
    		decl, ok := decl.(*ast.GenDecl)
    		if !ok || decl.Tok != token.CONST {
    			continue
    		}
    		for _, spec := range decl.Specs {
    			spec, ok := spec.(*ast.ValueSpec)
    			if !ok || len(spec.Names) == 0 {
    				continue
    			}
    			obj := info.ObjectOf(spec.Names[0])
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 18 20:41:45 UTC 2022
    - 4.9K bytes
    - Viewed (0)
  7. src/internal/types/testdata/check/constdecl.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package constdecl
    
    import "math"
    import "unsafe"
    
    var v int
    
    // Const decls must be initialized by constants.
    const _ = v /* ERROR "not constant" */
    const _ = math /* ERROR "not constant" */ .Sin(0)
    const _ = int /* ERROR "not an expression" */
    
    func _() {
    	const _ = v /* ERROR "not constant" */
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 31 16:11:16 UTC 2023
    - 3.7K bytes
    - Viewed (0)
  8. src/go/format/format.go

    // Node formats node in canonical gofmt style and writes the result to dst.
    //
    // The node type must be *[ast.File], *[printer.CommentedNode], [][ast.Decl],
    // [][ast.Stmt], or assignment-compatible to [ast.Expr], [ast.Decl], [ast.Spec],
    // or [ast.Stmt]. Node does not modify node. Imports are not sorted for
    // nodes representing partial source files (for instance, if the node is
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 12:02:03 UTC 2023
    - 4.3K bytes
    - Viewed (0)
  9. src/cmd/cgo/godefs.go

    	// use "T" as the mangling of C.whatever,
    	// except in the definition (handled at end of function).
    	refName := make(map[*ast.Expr]*Name)
    	for _, r := range f.Ref {
    		refName[r.Expr] = r.Name
    	}
    	for _, d := range f.AST.Decls {
    		d, ok := d.(*ast.GenDecl)
    		if !ok || d.Tok != token.TYPE {
    			continue
    		}
    		for _, s := range d.Specs {
    			s := s.(*ast.TypeSpec)
    			n := refName[&s.Type]
    			if n != nil && n.Mangle != "" {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 20 15:50:06 UTC 2024
    - 3.2K bytes
    - Viewed (0)
  10. src/internal/types/testdata/check/vardecl.go

    // license that can be found in the LICENSE file.
    
    package vardecl
    
    // Prerequisites.
    import "math"
    func f() {}
    func g() (x, y int) { return }
    var m map[string]int
    
    // Var decls must have a type or an initializer.
    var _ int
    var _, _ int
    
    var _; /* ERROR "expected type" */
    var _, _; /* ERROR "expected type" */
    var _, _, _; /* ERROR "expected type" */
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 17 19:54:27 UTC 2023
    - 5.8K bytes
    - Viewed (0)
Back to top