- Sort Score
- Result 10 results
- Languages All
Results 21 - 30 of 1,557 for comment2 (0.14 sec)
-
src/go/doc/comment/doc.go
The details of the syntax are documented at https://go.dev/doc/comment. To parse the text associated with a doc comment (after removing comment markers), use a [Parser]: var p comment.Parser doc := p.Parse(text) The result is a [*Doc]. To reformat it as a doc comment, HTML, Markdown, or plain text, use a [Printer]: var pr comment.Printer os.Stdout.Write(pr.Text(doc))
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Mon Jun 06 19:05:57 UTC 2022 - 1.3K bytes - Viewed (0) -
src/go/ast/example_test.go
// (the comments associated with the variable declaration), and create // the new comments list. f.Comments = cmap.Filter(f).Comments() // Print the modified AST. var buf strings.Builder if err := format.Node(&buf, fset, f); err != nil { panic(err) } fmt.Printf("%s", buf.String()) // Output: // // This is the package comment. // package main // // // This comment is associated with the hello constant.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 15 21:44:50 UTC 2024 - 6.1K bytes - Viewed (0) -
src/cmd/compile/internal/syntax/error_test.go
// // If the regular comment form is used, the reported error's position // must match the position of the token immediately following the // error comment. Thus, /* ERROR ... */ comments should appear // immediately before the position where the error is reported. // // Currently, the test harness only supports one error comment per // token. If multiple error comments appear before a token, only // the last one is considered.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Sep 20 02:13:02 UTC 2022 - 4.8K bytes - Viewed (0) -
src/go/ast/import.go
} else { // An import spec can have both block comment and a line comment // to its right. In that case, both of them will have the same pos. // But while formatting the AST, the line comment gets moved to // after the block comment. c.Slash = pos[i].End } } } } slices.SortFunc(comments, func(a, b *CommentGroup) int { return cmp.Compare(a.Pos(), b.Pos()) })
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:00:11 UTC 2024 - 5.7K bytes - Viewed (0) -
src/go/ast/commentmap_test.go
} cmap := NewCommentMap(fset, f, f.Comments) // very correct association of comments for n, list := range cmap { key := fmt.Sprintf("%2d: %T", fset.Position(n.Pos()).Line, n) got := ctext(list) want := res[key] if got != want { t.Errorf("%s: got %q; want %q", key, got, want) } } // verify that no comments got lost if n := len(cmap.Comments()); n != len(f.Comments) {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Sep 09 15:35:30 UTC 2022 - 3.9K bytes - Viewed (0) -
platforms/native/language-native/src/test/groovy/org/gradle/language/nativeplatform/internal/incremental/sourceparser/PreprocessingReaderTest.groovy
when: input = """ Here is a // comment string // Line comment with interspersed // comment /* with inline comment */ and // other comment */ chars line comments. """ then: output == "\nHere is a \nstring\n\nwith interspersed \nline comments." } def "can cope with multiple unescaped and escaped \\r characters"() { when:
Registered: Wed Jun 12 18:38:38 UTC 2024 - Last Modified: Thu Nov 16 20:20:03 UTC 2023 - 4.2K bytes - Viewed (0) -
src/go/ast/ast.go
if g == nil { return "" } comments := make([]string, len(g.List)) for i, c := range g.List { comments[i] = c.Text } lines := make([]string, 0, 10) // most comments are less than 10 lines for _, c := range comments { // Remove comment markers. // The parser has given us exactly the comment text. switch c[1] { case '/': //-style comment (no newline at the end) c = c[2:]
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/types/commentMap_test.go
"strings" "testing" ) type comment struct { line, col int // comment position text string // comment text, excluding "//", "/*", or "*/" } // commentMap collects all comments in the given src with comment text // that matches the supplied regular expression rx and returns them as // []comment lists in a map indexed by line number. The comment text is // the comment with any comment markers ("//", "/*", or "*/") stripped.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Jan 17 19:54:27 UTC 2023 - 3K bytes - Viewed (0) -
platforms/software/build-init/src/main/java/org/gradle/buildinit/plugins/internal/BuildScriptBuilder.java
*/ void writeCodeTo(PrettyPrinter printer); } private static abstract class AbstractStatement implements Statement { final String comment; AbstractStatement(@Nullable String comment) { this.comment = comment; } @Nullable
Registered: Wed Jun 12 18:38:38 UTC 2024 - Last Modified: Thu Dec 21 12:02:29 UTC 2023 - 90K bytes - Viewed (0) -
src/cmd/go/testdata/script/build_import_comment.txt
env GO111MODULE=off cd m # Import comment matches go build -n works.go # Import comment mismatch ! go build -n wrongplace.go stderr 'wrongplace expects import "my/x"' # Import comment syntax error ! go build -n bad.go stderr 'cannot parse import comment' # Import comment conflict ! go build -n conflict.go stderr 'found import comments' # Test in module mode.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Sep 17 13:25:29 UTC 2020 - 1.2K bytes - Viewed (0)