Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 264 for lineAt (0.62 sec)

  1. src/go/ast/import.go

    		d.Specs = specs
    
    		// Deduping can leave a blank line before the rparen; clean that up.
    		if len(d.Specs) > 0 {
    			lastSpec := d.Specs[len(d.Specs)-1]
    			lastLine := lineAt(fset, lastSpec.Pos())
    			rParenLine := lineAt(fset, d.Rparen)
    			for rParenLine > lastLine+1 {
    				rParenLine--
    				fset.File(d.Rparen).MergeLine(rParenLine)
    			}
    		}
    	}
    }
    
    func lineAt(fset *token.FileSet, pos token.Pos) int {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 5.7K bytes
    - Viewed (0)
  2. src/go/printer/gobuild.go

    		block = append(block, tabwriter.Escape, '\n')
    		if len(p.plusBuild) > 0 {
    			lines, err := constraint.PlusBuildLines(x)
    			if err != nil {
    				lines = []string{"// +build error: " + err.Error()}
    			}
    			for _, line := range lines {
    				block = append(block, tabwriter.Escape)
    				block = append(block, line...)
    				block = append(block, tabwriter.Escape, '\n')
    			}
    		}
    	}
    	block = append(block, '\n')
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 4.6K bytes
    - Viewed (0)
  3. src/go/printer/printer_test.go

    // before empty lines.
    func TestIssue5945(t *testing.T) {
    	const orig = `
    package p   // line 2
    func f() {} // line 3
    
    var x, y, z int
    
    
    func g() { // line 8
    }
    `
    
    	const want = `//line src.go:2
    package p
    
    //line src.go:3
    func f() {}
    
    var x, y, z int
    
    //line src.go:8
    func g() {
    }
    `
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 03 14:56:25 UTC 2024
    - 20.4K bytes
    - Viewed (0)
  4. src/debug/dwarf/line.go

    	buf := makeBuf(d, u, "line", Offset(off), d.line[off:])
    	// The compilation directory is implicitly directories[0].
    	r := LineReader{
    		buf:     buf,
    		section: d.line,
    		str:     d.str,
    		lineStr: d.lineStr,
    	}
    
    	// Read the header.
    	if err := r.readHeader(compDir); err != nil {
    		return nil, err
    	}
    
    	// Initialize line reader state.
    	r.Reset()
    
    	return &r, nil
    }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Oct 18 19:33:30 UTC 2023
    - 23.5K bytes
    - Viewed (0)
  5. src/go/scanner/scanner_test.go

    	{"\n//line foo 42\n  line44", "foo\t", 46, 0},  // bad line comment, ignored (use existing, prior filename)
    	{"\n//line /bar:42\n  line45", "/bar", 42, 0},
    	{"\n//line ./foo:42\n  line46", "foo", 42, 0},
    	{"\n//line a/b/c/File1.go:100\n  line100", "a/b/c/File1.go", 100, 0},
    	{"\n//line c:\\bar:42\n  line200", "c:\\bar", 42, 0},
    	{"\n//line c:\\dir\\File1.go:100\n  line201", "c:\\dir\\File1.go", 100, 0},
    
    	// tests for new line directive syntax
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 28 15:38:31 UTC 2023
    - 34.6K bytes
    - Viewed (0)
  6. src/debug/dwarf/testdata/line1.c

    #include "line1.h"
    
    void f2();
    
    int main()
    {
    	f1();
    	f2();
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 10 02:32:48 UTC 2015
    - 61 bytes
    - Viewed (0)
  7. src/debug/dwarf/testdata/line1.h

    Austin Clements <******@****.***> 1425666364 -0500
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 10 02:32:48 UTC 2015
    - 83 bytes
    - Viewed (0)
  8. src/debug/dwarf/testdata/line2.c

    Austin Clements <******@****.***> 1425666364 -0500
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 10 02:32:48 UTC 2015
    - 54 bytes
    - Viewed (0)
  9. src/cmd/internal/objabi/line.go

    Russ Cox <******@****.***> 1669995570 -0500
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 17 23:10:31 UTC 2023
    - 3.8K bytes
    - Viewed (0)
  10. src/cmd/internal/obj/line.go

    }
    
    // getFileIndexAndLine returns the relative file index (local to the CU), and
    // the relative line number for a position (i.e., as adjusted by a //line
    // directive). This is the file/line visible in the final binary (pcfile, pcln,
    // etc).
    func (ctxt *Link) getFileIndexAndLine(xpos src.XPos) (int, int32) {
    	pos := ctxt.InnermostPos(xpos)
    	if !pos.IsKnown() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 01 15:52:41 UTC 2023
    - 892 bytes
    - Viewed (0)
Back to top