diff --git a/Go/Fold.tmPreferences b/Go/Fold.tmPreferences index a7b25fbc75..58f11f1ddd 100644 --- a/Go/Fold.tmPreferences +++ b/Go/Fold.tmPreferences @@ -1,19 +1,25 @@ - scope - source.go - settings - - foldScopes - - - begin - punctuation.section.braces.begin - end - punctuation.section.braces.end - - - + scope + source.go + settings + + foldScopes + + + begin + punctuation.section.braces.begin + end + punctuation.section.braces.end + + + begin + punctuation.definition.comment.begin.go + end + punctuation.definition.comment.end.go + + + diff --git a/Go/Go.sublime-completions b/Go/Go.sublime-completions index fec862fd4a..17e3802626 100644 --- a/Go/Go.sublime-completions +++ b/Go/Go.sublime-completions @@ -2,6 +2,11 @@ "scope": "source.go", "completions": [ // https://golang.org/ref/spec#Keywords + { + "trigger": "any", + "contents": "any", + "kind": "type" + }, { "trigger": "append", "contents": "append", @@ -42,6 +47,11 @@ "contents": "close", "kind": "function" }, + { + "trigger": "comparable", + "contents": "comparable", + "kind": "type" + }, { "trigger": "complex", "contents": "complex", @@ -195,7 +205,7 @@ { "trigger": "make", "annotation": "make(type, 0)", - "contents": "make(${1:type}, 0)", + "contents": "make(${0:type}, 0)", "kind": "snippet" }, { diff --git a/Go/Go.sublime-syntax b/Go/Go.sublime-syntax index ae61a6e558..04c6ad55d6 100644 --- a/Go/Go.sublime-syntax +++ b/Go/Go.sublime-syntax @@ -55,6 +55,7 @@ name: Go scope: source.go +version: 2 file_extensions: - go @@ -70,19 +71,29 @@ variables: keyword: \b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go|goto|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b # https://golang.org/ref/spec#Predeclared_identifiers - predeclared_type: \b(?:bool|byte|complex64|complex128|error|float32|float64|int|int8|int16|int32|int64|rune|string|uint|uint8|uint16|uint32|uint64|uintptr)\b + predeclared_type: \b(?:any|bool|byte|comparable|complex64|complex128|error|float32|float64|int|int8|int16|int32|int64|rune|string|uint|uint8|uint16|uint32|uint64|uintptr)\b # https://golang.org/ref/spec#Predeclared_identifiers predeclared_func: \b(?:append|cap|close|complex|copy|delete|imag|len|make|new|panic|print|println|real|recover)\b + ident_anon: \b_\b + # Note: this matches ALL valid identifiers, including predeclared constants, # functions and types. - ident: \b(?!{{keyword}})[[:alpha:]_][[:alnum:]_]*\b + ident: (?!{{keyword}}){{keyword_or_ident}} + + keyword_or_ident: \b[[:alpha:]_][[:alnum:]_]*\b + + # Sublime normalizes newlines from `\r\n` and `\r` into `\n`. Sublime's syntax + # engine uses regexps line-by-line, so `$` is often equivalent to `\n`. For + # semantic accuracy, we should use `\n` when possible. However, the last line + # in a file may end with `$` INSTEAD of `\n`, so we must try both. + newline: (?:\n|$) # Directive comment key. directive: \b[[:alpha:]_-][[:alnum:]_-]*\b - # Single line only + # Single-line general comment. inline_comment: /[*](?:[^*]|[*](?!/))*[*]/ # Whitespace and general comments on a single line. @@ -107,31 +118,65 @@ variables: # Binary counterpart to dec_digits. bin_digits: (?:_?[01]+(?:_[01]+)*) + # Should be used only for lookahead. Syntactically ambiguous with many other + # uses of square brackets. Should be used ONLY in contexts where the use of + # brackets is unambiguous. + # + # Known defect: fails to recognize multiline type argument lists. + # We should convert from lookahead to branching. + type_argument_list: \[(?:{{noise}}|[^\[\]])*\] + + + iface_entry_delim: (?://|;|\}|{{newline}}) + struct_entry_delim: (?:"|`|{{iface_entry_delim}}) + struct_embed_argument_list: '{{type_argument_list}}{{noise}}{{struct_entry_delim}}' + + operator_char: '[!%&*+/:<=>^|-]' + operator_break: (?!{{operator_char}}) + + # Tokens that may signify the beginning of a type. Should be used only for + # lookahead, and only in contexts where this is unambiguous with other + # expressions. Doesn't include `*` because inside brackets, it would be + # ambiguous with multiplication, which may be used for array size. + type_begin: (?:~|\[|{{keyword_or_ident}}) + contexts: + prototype: + - include: match-comments + main: - include: match-any match-any: - - include: match-comments - include: match-tokens # https://golang.org/ref/spec#Comments match-comments: - # Go has magic comments in the form of: - # - # //go:some_directive arg0 arg1 ... - # - # These have been adopted outside the gc compiler for use in linting - # directives and pragmas for other compiler suites where they take the - # more generalised form of: - # - # //namespace:some_directive ... - # - # They're not part of the language spec, may not be recognized by some Go - # compilers, and may stop working in future releases. Therefore, - # highlighting them as compiler pragmas could be misleading. We scope them - # as plain comments by default, and add some detailed meta scopes for - # enterprising users wishing to add more color. + - include: match-comment-magic + - include: match-comment-line + - include: match-comment-general + + match-comment-magic: + - include: match-comment-magic-general + - include: match-comment-magic-line-renum + - include: match-comment-magic-line-extern + + # Go has magic comments in the form of: + # + # //go:directive arg0 arg1 ... + # + # These have been adopted outside the gc compiler for use in linting + # directives and pragmas for other compiler suites where they take the + # more generalised form of: + # + # //namespace:some_directive ... + # + # They're not part of the language spec, may not be recognized by some Go + # compilers, and may stop working in future releases. Therefore, highlighting + # them as compiler pragmas could be misleading. We scope them as plain + # comments by default, and add some detailed meta scopes for enterprising + # users wishing to add more color. + match-comment-magic-general: - match: (//)([a-z]+[a-z-]*)(:)({{directive}})([ ]?) scope: meta.annotation.go captures: @@ -142,12 +187,13 @@ contexts: 5: meta.punctuation.separator.space.go push: pop-line-annotation - # Go also has line renumbering; line directives specify the source - # position for the character immediately following the comment as - # having come from the specified file, line and column. Both single - # line and block comment line directives are valid. - - match: ((//)(line)( ))([a-zA-Z0-9. :]*(?::[0-9]+){1,2})$\n? - scope: comment.line.go + # Go also has line renumbering; line directives specify the source + # position for the character immediately following the comment as + # having come from the specified file, line and column. Both single + # line and block comment line directives are valid. + match-comment-magic-line-renum: + - match: ((//)(line)( ))([a-zA-Z0-9. :]*(?::[0-9]+){1,2}){{newline}}? + scope: comment.line.double-slash.go captures: 1: meta.annotation.go 2: punctuation.definition.comment.go @@ -165,9 +211,10 @@ contexts: 5: meta.annotation.parameters.go 6: meta.annotation.go punctuation.definition.comment.end.go - # Finally, Cgo and gccgo have directives for exporting functions to C. - - match: ((//)(export|extern)( ))({{ident}})$\n? - scope: comment.line.go + # Finally, Cgo and gccgo have directives for exporting functions to C. + match-comment-magic-line-extern: + - match: ((//)(export|extern)( ))({{ident}}){{newline}}? + scope: comment.line.double-slash.go captures: 1: meta.annotation.go 2: punctuation.definition.comment.go @@ -175,37 +222,36 @@ contexts: 4: meta.punctuation.separator.space.go 5: meta.annotation.parameters.go - # Line comment + pop-line-annotation: + - meta_scope: comment.line.double-slash.go + - meta_content_scope: meta.annotation.parameters.go + - include: pop-on-eol + + match-comment-line: - match: // scope: punctuation.definition.comment.go - push: pop-line-comment + push: pop-comment-line-normal + + pop-comment-line-normal: + - meta_scope: comment.line.double-slash.go + - include: pop-on-eol - # General comment + match-comment-general: - match: /\* scope: punctuation.definition.comment.begin.go - push: - - meta_scope: comment.block.go - - match: \*/ - scope: punctuation.definition.comment.end.go - pop: true - - match: ^\s*(\*)(?!/) - captures: - 1: punctuation.definition.comment.go - - pop-line-annotation: - - meta_scope: comment.line.go - - meta_content_scope: meta.annotation.parameters.go - - match: $\n? - pop: true - - pop-line-comment: - - meta_scope: comment.line.go - # Including the newline allows the scope to visually stretch to the right, - # and ensures that functionality that relies on comment scoping, such as - # contextual hotkeys, works properly at EOL while typing a comment. This - # should also match \r\n due to Sublime's internal normalization. - - match: $\n? - pop: true + push: pop-comment-general + + pop-comment-general: + - meta_scope: comment.block.go + - match: \*/ + scope: punctuation.definition.comment.end.go + pop: 1 + # Indentation, followed by exactly one space, followed by *. + # This enables support for javadoc comments, while avoiding false + # positives in non-javadoc comments that use "*" as simple list bullets. + - match: ^(?:\t|[ ]{2}|[ ]{4}|[ ]{8})*[ ](\*)(?!/) + captures: + 1: punctuation.definition.comment.go # https://golang.org/ref/spec#Tokens # @@ -251,8 +297,7 @@ contexts: - include: match-predeclared-constants - include: match-call-or-type-conversion - include: match-short-variable-declarations - - match: \b_\b - scope: variable.language.anonymous.go + - include: match-identifier-anon - match: '{{ident}}' scope: variable.other.go @@ -296,6 +341,7 @@ contexts: # However, we stick to `variable.function.go` to make the treatment of # built-ins purely additive, allowing the user to opt out. match-call-or-type-conversion: + - include: match-identifier-anon - match: \b(?:make|new)\b(?=(?:{{noise}}\))*{{noise}}\() scope: variable.function.go support.function.builtin.go push: pop-arguments-starting-with-type @@ -303,37 +349,35 @@ contexts: scope: variable.function.go support.type.builtin.go - match: '{{predeclared_func}}(?=(?:{{noise}}\))*{{noise}}\()' scope: variable.function.go support.function.builtin.go - - match: '{{ident}}(?=(?:{{noise}}\))*{{noise}}\()' + - match: '{{ident}}(?=(?:{{noise}}\))*(?:{{noise}}{{type_argument_list}})?{{noise}}\()' scope: variable.function.go - - # See notes on `match-call-or-type-conversion`. - pop-call-or-type-conversion: - - match: \b(?:make|new)\b(?=(?:{{noise}}\))*{{noise}}\() - scope: variable.function.go support.function.builtin.go - set: pop-arguments-starting-with-type - - match: '{{predeclared_type}}(?=(?:{{noise}}\))*{{noise}}\()' - scope: variable.function.go support.type.builtin.go - pop: true - - match: '{{predeclared_func}}(?=(?:{{noise}}\))*{{noise}}\()' - scope: variable.function.go support.function.builtin.go - pop: true + push: pop-type-argument-list - match: '{{ident}}(?=(?:{{noise}}\))*{{noise}}\()' scope: variable.function.go - pop: true # Note: this currently doesn't work across multiple lines. match-short-variable-declarations: - match: (?={{ident}}(?:{{noise}},{{noise}}{{ident}})*{{noise}}:=) push: - - include: match-comments - - match: \b_\b - scope: variable.language.anonymous.go + - include: match-identifier-anon - match: '{{ident}}' scope: variable.other.readwrite.declaration.go - include: match-comma - include: pop-before-nonblank + match-identifier-anon: + - match: '{{ident_anon}}' + scope: variable.language.anonymous.go + + pop-identifier-anon: + - match: '{{ident_anon}}' + scope: variable.language.anonymous.go + pop: 1 + # https://golang.org/ref/spec#Operators_and_punctuation + # + # Note: pipe "|" is not always bitwise. In type unions + # it should be scoped differently. match-operators: - match: '<<=|>>=|&\^=|&=|\^=|\|=|%=|\+=|-=|\*=|/=|\+\+|--' scope: keyword.operator.assignment.augmented.go @@ -351,11 +395,22 @@ contexts: scope: keyword.operator.bitwise.go - match: '[-+/%]' scope: keyword.operator.arithmetic.go - - match: '[*&]' + - match: '[*&~]' scope: keyword.operator.go + # Special characters that in some contexts may precede a type. + # Not all of them are allowed in all contexts. + # Bundling them together simplifies our syntax implementation. + match-type-operators: + - include: match-star + - include: match-union-pipe + match-star: - - match: \* + - match: \*{{operator_break}} + scope: keyword.operator.go + + match-union-pipe: + - match: \|{{operator_break}} scope: keyword.operator.go # https://golang.org/ref/spec#Operators_and_punctuation @@ -388,49 +443,70 @@ contexts: match-selector: - match: \. scope: punctuation.accessor.dot.go - push: - - include: match-comments - - include: pop-type-assertion - - # Note: we can't syntactically distinguish calls from type conversions. - # It's also not always possible to distinguish function calls from - # method calls. - - match: '{{ident}}(?=(?:{{noise}}\))*{{noise}}\()' - scope: variable.function.go - pop: true - - - include: pop-member - # Note: newlines between dot and assertion/field are ok. - - include: pop-before-nonblank + push: pop-selector + + pop-selector: + - match: '{{ident_anon}}(?!{{noise}}\()' + scope: variable.language.anonymous.go + pop: 1 + - match: '{{ident}}(?!{{noise}}\()' + scope: variable.other.member.go + pop: 1 + - match: \( + scope: punctuation.section.parens.begin.go + set: pop-type-assertion + - include: pop-before-nonblank + + pop-type-assertion: + - include: pop-on-paren-end + - include: match-type match-parens: - match: \( scope: punctuation.section.parens.begin.go - push: - - match: \) - scope: punctuation.section.parens.end.go - pop: true - - include: pop-call-or-type-conversion - - include: match-any + push: pop-parens-inner - match: \) - scope: punctuation.section.parens.end.go + scope: invalid.illegal.go + + pop-parens-inner: + - include: pop-on-paren-end + - include: match-any match-brackets: - match: \[ scope: punctuation.section.brackets.begin.go + push: [pop-after-brackets, pop-brackets-inner] - match: \] - scope: punctuation.section.brackets.end.go - push: - - include: pop-on-terminator - - include: match-comments - - include: match-star - - match: '{{ident}}(?={{noise}}\.)' - scope: variable.other.go - - match: \b_\b - scope: variable.language.anonymous.go - pop: true - - include: pop-type-identifier - - include: pop-before-nonblank + scope: invalid.illegal.go + + pop-brackets-inner: + - match: '' + pop: 1 + branch_point: point-brackets-inner + branch: + - pop-brackets-inner-type-parameter-list + - pop-brackets-inner-any + + pop-brackets-inner-type-parameter-list: + - match: (?={{ident}}{{noise}}(?:,|{{type_begin}})) + set: pop-type-parameter-list-inner + - match: (?=\S) + fail: point-brackets-inner + + pop-brackets-inner-any: + - include: pop-on-bracket-end + - include: match-any + + # Known bug: + # + # _ = ident[0] * ident + # + # This currently parses as an array type of `[0]*ident`. + # Can we ever fix this false positive? + pop-after-brackets: + - include: pop-before-terminator + - include: match-type-operators + - include: pop-type-identifier # TODO: consider detecting composite literals. In principle, it should allow # us to drop the erroneous "meta.block" from composite literals, detect field @@ -444,14 +520,13 @@ contexts: match-braces: - match: \{ scope: punctuation.section.braces.begin.go - push: - - meta_scope: meta.block.go - - match: \} - scope: punctuation.section.braces.end.go - pop: true - - include: match-any + push: [meta-block, pop-braces-inner] - match: \} - scope: punctuation.section.braces.end.go + scope: invalid.illegal.go + + pop-braces-inner: + - include: pop-on-brace-end + - include: match-any match-literals: - include: match-imaginary @@ -572,10 +647,11 @@ contexts: - match: '`' scope: punctuation.definition.string.begin.go push: - - meta_scope: string.quoted.other.go + - meta_include_prototype: false + - meta_scope: string.quoted.backtick.go - match: '`' scope: punctuation.definition.string.end.go - pop: true + pop: 1 - include: match-template-string - match: \%% scope: constant.character.escape.go @@ -585,10 +661,11 @@ contexts: - match: '"' scope: punctuation.definition.string.begin.go push: + - meta_include_prototype: false - meta_scope: string.quoted.double.go - match: '"' scope: punctuation.definition.string.end.go - pop: true + pop: 1 - include: match-template-string - match: '{{char_escape}}' scope: constant.character.escape.go @@ -604,7 +681,7 @@ contexts: - clear_scopes: 1 - match: "}}" scope: punctuation.section.interpolation.end.go - pop: true + pop: 1 - match: "\\s-" scope: keyword.operator.template.right.trim.go - match: "-\\s" @@ -627,7 +704,6 @@ contexts: scope: keyword.control.go - match: \b(and|call|html|index|slice|js|len|not|or|print|printf|println|urlquery|eq|ne|lt|le|gt|ge)\b scope: variable.function.go support.function.builtin.go - - include: match-comments - include: match-strings # https://godoc.org/fmt @@ -658,35 +734,36 @@ contexts: - match: \( scope: punctuation.section.parens.begin.go set: - - match: \) - scope: punctuation.section.parens.end.go - pop: true + - include: pop-on-paren-end - - match: \b_\b(?={{noise}},) + - match: '{{ident_anon}}(?={{noise}},)' scope: variable.language.anonymous.go + - match: '{{ident}}(?={{noise}},)' scope: variable.other.constant.declaration.go - - match: \b_\b + - match: '{{ident_anon}}' scope: variable.language.anonymous.go push: pop-const-type-and-or-assignment + - match: '{{ident}}' scope: variable.other.constant.declaration.go push: pop-const-type-and-or-assignment - include: match-any - - include: match-comments - include: match-comma - - match: \b_\b(?={{noise}},) + - match: '{{ident_anon}}(?={{noise}},)' scope: variable.language.anonymous.go + - match: '{{ident}}(?={{noise}},)' scope: variable.other.constant.declaration.go - - match: \b_\b + - match: '{{ident_anon}}' scope: variable.language.anonymous.go set: pop-const-type-and-or-assignment + - match: '{{ident}}' scope: variable.other.constant.declaration.go set: pop-const-type-and-or-assignment @@ -720,27 +797,19 @@ contexts: match-keyword-func: - match: \bfunc\b scope: keyword.declaration.function.go - push: - - include: match-comments + push: [meta-function-declaration, pop-func] - # Method - - match: (?=\({{noise}}[^)]+{{noise}}\){{noise}}{{ident}}{{noise}}\() - set: - - meta_scope: meta.function.declaration.go - - match: (?=[^(]) - set: - - meta_scope: meta.function.declaration.go - - include: pop-func-signature - # Receiver list - - match: (?=\() - push: pop-func-parameter-list - - # Named function - - match: (?={{ident}}{{noise}}\() - set: pop-func-signature - - # Anonymous function - - include: pop-func-parameter-and-return-lists + pop-func: + # Known false positive: + # + # func(param Type[TypeArg]) Name[Type] {} + # + # In this example, the anonymous function is incorrectly scoped as a method, + # where `Name` is scoped as method name rather than type. TODO avoid. + # A proper implementation may involve complicated branching. + - match: (?=\([^()]*\){{noise}}{{ident}}{{noise}}[\[\(]) + set: [pop-func-signature, pop-func-method-receiver] + - include: pop-func-signature match-keyword-go: - match: \bgo\b @@ -768,13 +837,14 @@ contexts: match-keyword-package: - match: \bpackage\b - scope: storage.type.namespace.go keyword.declaration.namespace.go - push: - - meta_scope: meta.namespace.go - - match: '{{ident}}' - scope: entity.name.namespace.go - pop: true - - include: pop-before-nonblank + scope: keyword.declaration.namespace.go + push: [meta-namespace, pop-package-name] + + pop-package-name: + - match: '{{ident}}' + scope: entity.name.namespace.go + pop: 1 + - include: pop-before-nonblank match-keyword-range: - match: \brange\b @@ -799,37 +869,30 @@ contexts: match-keyword-type: - match: \btype\b scope: keyword.declaration.type.go - push: - - include: match-comments + push: pop-type-declaration-or-list - - match: \( - scope: punctuation.section.parens.begin.go - set: - - match: \) - scope: punctuation.section.parens.end.go - pop: true - - match: \b_\b - scope: variable.language.anonymous.go - push: - - match: (?=\)) - pop: true - - include: pop-type-alias-or-typedef - - match: '{{ident}}' - scope: entity.name.type.go - push: - - match: (?=\)) - pop: true - - include: pop-type-alias-or-typedef - - include: match-any + pop-type-declaration-or-list: + - match: \( + scope: punctuation.section.parens.begin.go + set: pop-type-declaration-list + - include: pop-type-declaration - - match: \b_\b - scope: variable.language.anonymous.go - set: pop-type-alias-or-typedef - - match: '{{ident}}' - scope: entity.name.type.go - set: pop-type-alias-or-typedef + pop-type-declaration-list: + - include: pop-on-paren-end + - match: (?={{ident}}) + push: pop-type-declaration + - include: match-any - - include: pop-before-nonblank + pop-type-declaration: + - match: '{{ident_anon}}' + scope: variable.language.anonymous.go + set: pop-type-spec + + - match: '{{ident}}' + scope: entity.name.type.go + set: pop-type-spec + + - include: pop-before-nonblank match-keyword-var: - match: \bvar\b @@ -838,102 +901,126 @@ contexts: - match: \( scope: punctuation.section.parens.begin.go set: - - match: \) - scope: punctuation.section.parens.end.go - pop: true + - include: pop-on-paren-end - - match: \b_\b(?={{noise}},) + - match: '{{ident_anon}}(?={{noise}},)' scope: variable.language.anonymous.go + - match: '{{ident}}(?={{noise}},)' scope: variable.other.readwrite.declaration.go - - match: \b_\b + - match: '{{ident_anon}}' scope: variable.language.anonymous.go push: pop-var-type-and-or-assignment + - match: '{{ident}}' scope: variable.other.readwrite.declaration.go push: pop-var-type-and-or-assignment - include: match-any - - include: match-comments - include: match-comma - - match: \b_\b(?={{noise}},) + - match: '{{ident_anon}}(?={{noise}},)' scope: variable.language.anonymous.go + - match: '{{ident}}(?={{noise}},)' scope: variable.other.readwrite.declaration.go - - match: \b_\b + - match: '{{ident_anon}}' scope: variable.language.anonymous.go set: pop-var-type-and-or-assignment + - match: '{{ident}}' scope: variable.other.readwrite.declaration.go set: pop-var-type-and-or-assignment - include: pop-before-nonblank + pop-func-method-receiver: + - match: \( + scope: punctuation.section.parens.begin.go + set: pop-func-method-receiver-inner + - include: pop-before-nonblank + + pop-func-method-receiver-inner: + - include: pop-on-paren-end + - include: match-type-operators + - include: match-namespace + + # The lookahead is too special-case. TODO improve. + - match: '{{ident_anon}}(?={{noise}}(?:\*|{{ident}}))' + scope: variable.language.anonymous.go + - match: '{{ident}}(?={{noise}}(?:\*|{{ident}}))' + scope: variable.parameter.go + + - match: '{{ident}}' + scope: storage.type.go + push: pop-type-parameter-list-simple + + - include: match-any + pop-func-signature: - - include: match-comments - - match: \b_\b + - match: (?=\S) + set: [pop-func-parameter-and-return-lists, pop-type-parameter-list, pop-func-name] + + pop-func-name: + - match: '{{ident_anon}}' scope: variable.language.anonymous.go - set: pop-func-parameter-and-return-lists + pop: 1 + - match: '{{ident}}' scope: entity.name.function.go - set: pop-func-parameter-and-return-lists + pop: 1 + - include: pop-before-nonblank + pop-func-parameter-and-return-lists: + - match: (?=\() + set: [pop-func-return-signature, pop-func-parameter-list] + - include: pop-before-nonblank + + pop-func-return-signature: + - include: pop-before-terminator + - match: (?=\() + set: pop-func-parameter-list + - include: pop-type + # https://golang.org/ref/spec#Function_types # # Go has two parameter syntaxes: unnamed and named. # # Unnamed: # - # (int) - # (int, int) - # (int, int, ...int) + # (typ) + # (typ, typ) + # (typ, typ, ...typ) # # Named: # - # (a int) - # (a, b int) - # (a, b ...int) - # (a int, b int) - # (a, b int, c ...int) + # (a typ) + # (a, b typ) + # (a, b ...typ) + # (a typ, b typ) + # (a, b typ, c ...typ) # # The modes are distinct: either all named, or all unnamed. # # Gotchas: # - # parameters can span multiple lines - # a type can span multiple lines (anonymous struct, interface, etc.) - # parameter groups AND parameter names are comma-separated - # `chan type` is a type that looks like an identifier followed by a type + # * Parameters can span multiple lines. + # * A type can span multiple lines (anonymous struct, interface, etc.). + # * Parameter groups AND parameter names are comma-separated. + # * `chan type` is a type that looks like an identifier followed by a type. # - # I have an impression that with the current syntax engine, it's impossible to - # perfectly parse some parameter lists, particularly ones that are named, - # multiline, and have name groups. We're still trying to cover as many edge - # cases as possible. - pop-func-parameter-and-return-lists: - - include: match-comments - - match: (?=\() - set: [pop-func-return-signature, pop-func-parameter-list] - - include: pop-before-nonblank - - pop-func-return-signature: - - include: pop-on-terminator - - include: match-comments - - match: (?=\() - set: pop-func-parameter-list - - match: (?=\S) - set: pop-type - + # The current implementation is imperfect: when a group of comma-separated + # parameters spans multiple lines, we incorrectly assume "unnamed" mode. + # However, a "perfect" implementation requires multiline lookahead or + # branching. The current approach works for most real code. pop-func-parameter-list: - - include: match-comments - match: \( scope: punctuation.section.parens.begin.go set: - - include: match-comments - match: | (?x) (?= @@ -946,196 +1033,288 @@ contexts: - include: pop-before-nonblank pop-parameter-list-named: - - match: \) - scope: punctuation.section.parens.end.go - pop: true - - include: match-comments + - include: pop-on-paren-end - include: match-keywords - include: match-comma - include: match-ellipsis - - match: \b_\b + + - match: '{{ident_anon}}' scope: variable.language.anonymous.go push: pop-parameter-type + - match: '{{ident}}' scope: variable.parameter.go push: pop-parameter-type pop-parameter-type: - match: (?=\)|,) - pop: true + pop: 1 - include: match-ellipsis - include: pop-type pop-parameter-list-unnamed: - - match: \) - scope: punctuation.section.parens.end.go - pop: true - - include: match-comments - - include: match-keywords + - include: pop-on-paren-end - include: match-comma - include: match-ellipsis - - match: (?=\S) + - include: match-keywords + - include: match-type + + # At the time of writing, this is the only part of Go that uses "untyped" + # syntax for parameters, similar to function definitions in dynamic languages + # or closure definitions in typed languages such as Java lambdas. + # + # Note: this should not be confused with `pop-type-parameter-list` that + # uses "typed" syntax. + pop-type-parameter-list-simple: + - match: \[ + scope: punctuation.section.brackets.begin.go + set: pop-type-parameter-list-simple-inner + - include: pop-before-nonblank + + pop-type-parameter-list-simple-inner: + - include: pop-on-bracket-end + - include: match-identifier-anon + - match: '{{ident}}' + scope: variable.parameter.type.go + - include: match-any + + # Note: this should not be confused with `pop-type-parameter-list-simple` or + # `pop-type-argument-list`. + pop-type-parameter-list: + - match: \[ + scope: punctuation.section.brackets.begin.go + set: pop-type-parameter-list-inner + - include: pop-before-nonblank + + # Unlike value parameter lists that have both named and anonymous modes, + # type parameter lists have only the named mode. Parameter names must exist. + pop-type-parameter-list-inner: + - include: pop-on-bracket-end + - match: '{{ident_anon}}(?={{noise}},)' + scope: variable.language.anonymous.go + - match: '{{ident}}(?={{noise}},)' + scope: variable.parameter.type.go + - match: '{{ident_anon}}' + scope: variable.language.anonymous.go push: pop-type + - match: '{{ident}}' + scope: variable.parameter.type.go + push: pop-type + - include: match-any + + # Note: this should not be confused with `pop-type-parameter-list`. + pop-type-argument-list: + - include: pop-before-terminator + - match: \[ + scope: punctuation.section.brackets.begin.go + set: pop-type-argument-list-inner + - include: pop-before-nonblank + + pop-type-argument-list-inner: + - include: pop-on-bracket-end + - include: match-identifier-anon + - match: '{{ident}}' + scope: variable.other.type.go + - include: match-any + + pop-now: + - match: '' + pop: 1 pop-before-nonblank: - match: (?=\S) - pop: true + pop: 1 - pop-on-semicolon: - - match: ; - scope: punctuation.terminator.go - pop: true + pop-before-semicolon: + - match: (?=;) + pop: 1 - pop-on-terminator: - - include: pop-on-semicolon - - match: $ - pop: true + pop-before-newline: + - match: (?={{newline}}) + pop: 1 + + pop-before-terminator: + - include: pop-before-semicolon + - include: pop-before-newline + + pop-before-paren-end: + - match: (?=\)) + pop: 1 + + pop-on-paren-end: + - match: \) + scope: punctuation.section.parens.end.go + pop: 1 + + pop-before-bracket-end: + - match: (?=\]) + pop: 1 + + pop-on-bracket-end: + - match: \] + scope: punctuation.section.brackets.end.go + pop: 1 + + pop-on-brace-end: + - match: \} + scope: punctuation.section.braces.end.go + pop: 1 + + pop-before-brace-end: + - match: (?=\}) + pop: 1 + + match-type: + - match: (?=\S) + push: [pop-after-type, pop-type-single] pop-type: - - include: pop-on-semicolon - - include: match-comments + - match: (?=\S) + set: [pop-after-type, pop-type-single] + + pop-type-single: + - include: pop-before-semicolon # Note: Go allows wrapping types in an arbitrary number of parens. - match: \( scope: punctuation.section.parens.begin.go push: [pop-type-nested-in-parens, pop-type] - - match: \[ - scope: punctuation.section.brackets.begin.go - set: - - match: \] - scope: punctuation.section.brackets.end.go - # BUG: - # _ = blah[0] * blah - # This currently parses as an array type of `[0]*blah`. - # Can we fix this false positive? - set: pop-type - - include: match-any - + - include: match-type-operators - include: match-operators - match: (?=\bchan\b) set: pop-chan + - match: (?=\binterface\b) set: pop-interface + - match: (?=\bmap\b) set: pop-map + - match: (?=\bstruct\b) set: pop-struct + - match: \bfunc\b scope: keyword.declaration.function.go set: pop-func-parameter-and-return-lists + - match: (?={{ident}}) - set: pop-named-type + set: pop-type-identifier + + - match: \[ + scope: punctuation.section.brackets.begin.go + set: [pop-after-brackets, pop-brackets-inner] - include: pop-before-nonblank + pop-after-type: + - match: \|{{operator_break}} + scope: keyword.operator.go + set: pop-type + - include: pop-before-newline + - include: pop-before-nonblank + pop-type-nested-in-parens: - - match: \) - scope: punctuation.section.parens.end.go - pop: true - - include: pop-type + # The implementation is fairly similar. Parameter lists allow some + # additional tokens, which shouldn't occur here. + - include: pop-parameter-list-unnamed pop-struct: - match: \bstruct\b scope: keyword.declaration.struct.go - set: - - include: match-comments - - match: \{ - scope: punctuation.section.braces.begin.go - set: - - meta_scope: meta.type.go + set: pop-struct-block - - match: \} - scope: punctuation.section.braces.end.go - pop: true + pop-struct-block: + - match: \{ + scope: punctuation.section.braces.begin.go + set: [meta-type, pop-struct-block-inner] + - include: pop-before-nonblank - - include: match-keywords - - include: match-star + pop-struct-block-inner: + - include: pop-on-brace-end + - include: match-keywords + - include: match-type-operators + - include: match-namespace - - match: '{{ident}}(?={{noise}}\.)' - scope: variable.other.go - - match: \. - scope: punctuation.accessor.dot.go - - match: '{{predeclared_type}}(?={{noise}}(?:"|`|//|;|\}|$))' - scope: entity.other.inherited-class.go support.type.builtin.go - - match: '{{ident}}(?={{noise}}(?:"|`|//|;|\}|$))' - scope: entity.other.inherited-class.go + - match: '{{ident_anon}}(?={{noise}}{{struct_embed_argument_list}})' + scope: variable.language.anonymous.go + push: pop-type-argument-list - - match: \b_\b - scope: variable.language.anonymous.go - - match: '{{ident}}' - scope: variable.other.member.declaration.go - push: - - match: (?=\}) - pop: true - - include: pop-on-terminator - - include: match-comments - - include: pop-type - - include: match-any + - match: '{{ident}}(?={{noise}}{{struct_embed_argument_list}})' + scope: entity.other.inherited-class.go + push: pop-type-argument-list - - include: match-any + - match: '{{predeclared_type}}(?={{noise}}{{struct_entry_delim}})' + scope: entity.other.inherited-class.go support.type.builtin.go - - include: pop-before-nonblank + - include: match-identifier-anon + + - match: '{{ident}}(?={{noise}}{{struct_entry_delim}})' + scope: entity.other.inherited-class.go + + - match: '{{ident}}' + scope: variable.other.member.declaration.go + push: pop-struct-field-meta + + - include: match-any + + pop-struct-field-meta: + - include: pop-before-brace-end + - include: pop-before-terminator + - include: pop-type pop-interface: - match: \binterface\b scope: keyword.declaration.interface.go - set: - - include: match-comments - - match: \{ - scope: punctuation.section.braces.begin.go - set: - - meta_scope: meta.type.go - - match: \} - scope: punctuation.section.braces.end.go - pop: true - - - include: match-keywords - - include: match-star - - - match: '{{ident}}(?={{noise}}\.)' - scope: variable.other.go - - match: \. - scope: punctuation.accessor.dot.go - - match: '{{predeclared_type}}(?={{noise}}(?://|;|\}|$))' - scope: entity.other.inherited-class.go support.type.builtin.go - - match: '{{ident}}(?={{noise}}(?://|;|\}|$))' - scope: entity.other.inherited-class.go - - - match: '{{ident}}(?={{noise}}\()' - scope: entity.name.function.go - push: - - match: (?=\}) - pop: true - - include: pop-func-parameter-and-return-lists + set: [meta-type, pop-interface-block] - - include: match-any - - include: pop-before-nonblank + pop-interface-block: + - match: \{ + scope: punctuation.section.braces.begin.go + set: pop-interface-inner + - include: pop-before-nonblank + + # Ideally we would scope embedded interfaces as `entity.other.inherited-class` + # rather than `storage.type`. Prior to Go 1.18 and type unions, it was + # possible to detect embedding unambiguously. With the advent of unions, + # embeddings are syntactically indistinguishable from single-element unions. + pop-interface-inner: + - include: pop-on-brace-end + - include: match-keywords + - include: match-namespace + - include: match-type-operators + + - match: '{{ident}}(?={{noise}}\()' + scope: entity.name.function.go + push: pop-func-parameter-and-return-lists + + - match: '{{predeclared_type}}' + scope: storage.type.go support.type.builtin.go + + - match: '{{ident}}' + scope: storage.type.go + + - include: match-any pop-map: # Note: newlines between `map` and `[` are ok, but newlines after `]` # terminate the type. - match: \bmap\b scope: keyword.declaration.map.go - set: - - include: match-comments - - include: pop-on-semicolon - - match: \[ - scope: punctuation.section.brackets.begin.go - set: - - match: \] - scope: punctuation.section.brackets.end.go - set: - - include: pop-on-terminator - - include: pop-type - - include: match-comments - - match: (?=\S) - push: - - match: (?=\]) - pop: true - - include: pop-type - - include: pop-type + set: [meta-type, pop-map-brackets] + + pop-map-brackets: + - match: \[ + scope: punctuation.section.brackets.begin.go + set: pop-map-brackets-inner + - include: pop-before-nonblank + + pop-map-brackets-inner: + - match: \] + scope: punctuation.section.brackets.end.go + set: pop-type + - include: match-type # Note: newlines between `chan`, subsequent arrow, and subsequent type, are # perfectly ok. @@ -1144,42 +1323,29 @@ contexts: scope: keyword.declaration.chan.go set: pop-type - pop-named-type: - - include: match-comments - - match: \b_\b - scope: variable.language.anonymous.go - pop: true - - match: '{{ident}}(?={{noise}}\.)' - scope: variable.other.go - - match: \. - scope: punctuation.accessor.dot.go - - match: \b_\b - scope: variable.language.anonymous.go - pop: true - - include: pop-type-identifier - - include: pop-before-nonblank - pop-type-identifier: + - include: match-namespace + - match: '{{ident_anon}}' + scope: variable.language.anonymous.go + set: pop-type-argument-list - match: '{{predeclared_type}}' scope: storage.type.go support.type.builtin.go - pop: true + set: pop-type-argument-list - match: '{{ident}}' scope: storage.type.go - pop: true + set: pop-type-argument-list + - include: pop-before-nonblank - pop-type-alias-or-typedef: - - include: pop-on-terminator - - include: match-comments + pop-type-spec: + - include: pop-before-terminator # Newlines after `=` are ok. - match: = scope: keyword.operator.assignment.go set: pop-type - - match: (?=\S) - set: pop-type + - include: pop-type pop-const-type-and-or-assignment: - - include: pop-on-terminator - - include: match-comments + - include: pop-before-terminator - match: = scope: keyword.operator.assignment.go set: pop-const-expressions @@ -1187,8 +1353,7 @@ contexts: set: [pop-const-assignment-or-terminate, pop-type] pop-const-assignment-or-terminate: - - include: pop-on-terminator - - include: match-comments + - include: pop-before-terminator - match: = scope: keyword.operator.assignment.go set: pop-const-expressions @@ -1202,18 +1367,16 @@ contexts: # redefine it. Doing so in the root scope makes the magic constant unavailable # for the entire package. pop-const-expressions: - - include: pop-on-semicolon - - include: match-comments + - include: pop-before-semicolon - match: (?=\S) set: - - include: pop-on-terminator + - include: pop-before-terminator - match: \biota\b scope: constant.language.go - include: match-any pop-var-type-and-or-assignment: - - include: pop-on-terminator - - include: match-comments + - include: pop-before-terminator - match: = scope: keyword.operator.assignment.go set: pop-var-expressions @@ -1221,8 +1384,7 @@ contexts: set: [pop-var-assignment-or-terminate, pop-type] pop-var-assignment-or-terminate: - - include: pop-on-terminator - - include: match-comments + - include: pop-before-terminator - match: = scope: keyword.operator.assignment.go set: pop-var-expressions @@ -1230,44 +1392,62 @@ contexts: # Note: this doesn't support multiline expressions. pop-var-expressions: - - include: pop-on-semicolon - - include: match-comments + - include: pop-before-semicolon - match: (?=\S) set: - - include: pop-on-terminator + - include: pop-before-terminator - include: match-any - pop-type-assertion: - - match: \( - scope: punctuation.section.parens.begin.go - set: - - match: \) - scope: punctuation.section.parens.end.go - pop: true - - include: pop-type - pop-member: - - match: \b_\b + - match: '{{ident_anon}}' scope: variable.language.anonymous.go - pop: true + pop: 1 + - match: '{{ident}}' scope: variable.other.member.go - pop: true + pop: 1 pop-arguments-starting-with-type: - - include: match-comments # Go allows functions and types to be wrapped in an arbitrary number of # parens. These are not part of the call. - - match: \) - scope: punctuation.section.parens.end.go - match: \( scope: punctuation.section.parens.begin.go - set: - - match: \) - scope: punctuation.section.parens.end.go - pop: true - - include: match-comments - - match: (?=\S) - set: pop-type - - include: pop-on-terminator + set: [pop-inside-parens, pop-type] - include: pop-before-nonblank + + # Including the newline allows the scope to visually stretch to the right, + # and ensures that functionality that relies on comment scoping, such as + # contextual hotkeys, works properly at EOL while typing a comment. + pop-on-eol: + - match: '{{newline}}' + pop: 1 + + pop-inside-parens: + - include: pop-on-paren-end + - include: match-any + + match-namespace: + - match: '({{ident}})\s*(\.)' + captures: + 1: variable.other.go + 2: punctuation.accessor.dot.go + + meta-function-declaration: + - meta_include_prototype: false + - meta_scope: meta.function.declaration.go + - include: pop-now + + meta-block: + - meta_include_prototype: false + - meta_scope: meta.block.go + - include: pop-now + + meta-type: + - meta_include_prototype: false + - meta_scope: meta.type.go + - include: pop-now + + meta-namespace: + - meta_include_prototype: false + - meta_scope: meta.namespace.go + - include: pop-now diff --git a/Go/syntax_test_go.go b/Go/syntax_test_go.go index cf3403bb0f..5c771b66cf 100644 --- a/Go/syntax_test_go.go +++ b/Go/syntax_test_go.go @@ -10,18 +10,17 @@ This file must not be formatted with `go fmt`. You may have to disable Go-specific linters when working on this file. */ - -// # Comments +/* # Comments */ // // ^ -comment -punctuation // ^^ punctuation.definition.comment.go -// ^^^ comment.line.go +// ^^^ comment.line.double-slash.go // comment // comment // ^ -comment -punctuation // ^^ punctuation.definition.comment.go -// ^^^^^^^^^^^^^^^^^^^^^^ comment.line.go +// ^^^^^^^^^^^^^^^^^^^^^^ comment.line.double-slash.go // ^^ -punctuation /* comment // comment */ // comment @@ -32,100 +31,112 @@ You may have to disable Go-specific linters when working on this file. // ^^ punctuation.definition.comment.end.go // ^^ -comment -punctuation // ^^ punctuation.definition.comment.go -// ^^^^^^^^^^^ comment.line.go +// ^^^^^^^^^^^ comment.line.double-slash.go /* // ^ -comment +// ^^ comment.block.go punctuation.definition.comment.begin.go +// ^^ comment.block.go - punctuation // ^^^^ comment.block.go comment // ^^^^^^^^ comment.block.go */ -// ^^ comment.block.go +//^^ comment.block.go - punctuation +// ^^ comment.block.go punctuation.definition.comment.end.go // ^ -comment /* * */ // ^ -comment // ^^^^^^^ comment.block.go +// ^^ punctuation.definition.comment.begin.go +// ^^^ -punctuation.definition.comment.go +// ^^ punctuation.definition.comment.end.go // ^ -comment - /** + /* + * +// ^ -punctuation.definition.comment.go + + * +// ^ -punctuation.definition.comment.go + * -// ^ comment.block.go punctuation.definition.comment.go +// ^ punctuation.definition.comment.go */ //go // ^ -comment -punctuation // ^^ punctuation.definition.comment.go -// ^^^^ comment.line.go -meta.annotation +// ^^^^ comment.line.double-slash.go -meta.annotation //go: // ^ -comment -punctuation // ^^ punctuation.definition.comment.go -// ^^^^^ comment.line.go -meta.annotation +// ^^^^^ comment.line.double-slash.go -meta.annotation //go:generate one two three // ^ -comment -meta -punctuation // ^^ punctuation.definition.comment.go -// ^^^^^^^^^^^^^^ comment.line.go meta.annotation.go +// ^^^^^^^^^^^^^ comment.line.double-slash.go meta.annotation.go // ^^ meta.keyword.annotation.go // ^^^^^^^^ meta.variable.function.go -// ^^^^^^^^^^^^^ comment.line.go meta.annotation.parameters.go -// ^ comment.line.go -meta.annotation +// ^^^^^^^^^^^^^ comment.line.double-slash.go meta.annotation.parameters.go +// ^ comment.line.double-slash.go -meta.annotation //go-sumtype:decl MySumType // ^ -comment -meta -punctuation // ^^ punctuation.definition.comment.go -// ^^^^^^^^^^^^^^^^^^ comment.line.go meta.annotation.go +// ^^^^^^^^^^^^^^^^^ comment.line.double-slash.go meta.annotation.go // ^^^^^^^^^^ meta.keyword.annotation.go // ^^^^ meta.variable.function.go -// ^^^^^^^^^ comment.line.go meta.annotation.parameters.go -// ^ comment.line.go -meta.annotation +// ^^^^^^^^^ comment.line.double-slash.go meta.annotation.parameters.go +// ^ comment.line.double-slash.go -meta.annotation //lint:ignore U1000 Reason. // ^ -comment -meta -punctuation // ^^ punctuation.definition.comment.go -// ^^^^^^^^^^^^^^ comment.line.go meta.annotation.go +// ^^^^^^^^^^^^^ comment.line.double-slash.go meta.annotation.go // ^^^^ meta.keyword.annotation.go // ^^^^^^ meta.variable.function.go -// ^^^^^^^^^^^^^ comment.line.go meta.annotation.parameters.go -// ^ comment.line.go -meta.annotation +// ^^^^^^^^^^^^^ comment.line.double-slash.go meta.annotation.parameters.go +// ^ comment.line.double-slash.go -meta.annotation //lint:file-ignore Reason. // ^ -comment -meta -punctuation // ^^ punctuation.definition.comment.go -// ^^^^^^^^^^^^^^^^^^^ comment.line.go meta.annotation.go +// ^^^^^^^^^^^^^^^^^^ comment.line.double-slash.go meta.annotation.go // ^^^^ meta.keyword.annotation.go // ^^^^^^^^^^^ meta.variable.function.go -// ^^^^^^^ comment.line.go meta.annotation.parameters.go -// ^ comment.line.go -meta.annotation +// ^^^^^^^ comment.line.double-slash.go meta.annotation.parameters.go +// ^ comment.line.double-slash.go -meta.annotation //line :10 // ^ -comment -meta -punctuation // ^^ punctuation.definition.comment.go -// ^^^^^^^ comment.line.go meta.annotation.go +// ^^^^^^ comment.line.double-slash.go meta.annotation.go // ^^^^ meta.variable.function.go -// ^^^ comment.line.go meta.annotation.parameters.go -// ^ comment.line.go -meta.annotation +// ^^^ comment.line.double-slash.go meta.annotation.parameters.go +// ^ comment.line.double-slash.go -meta.annotation //line file.rl:10 // ^ -comment -meta -punctuation // ^^ punctuation.definition.comment.go -// ^^^^^^^ comment.line.go meta.annotation.go +// ^^^^^^ comment.line.double-slash.go meta.annotation.go // ^^^^ meta.variable.function.go -// ^^^^^^^^^^ comment.line.go meta.annotation.parameters.go -// ^ comment.line.go -meta.annotation +// ^^^^^^^^^^ comment.line.double-slash.go meta.annotation.parameters.go +// ^ comment.line.double-slash.go -meta.annotation //line file.rl:100:10 // ^ -comment -meta -punctuation // ^^ punctuation.definition.comment.go -// ^^^^^^^ comment.line.go meta.annotation.go +// ^^^^^^ comment.line.double-slash.go meta.annotation.go // ^^^^ meta.variable.function.go -// ^^^^^^^^^^^^^^ comment.line.go meta.annotation.parameters.go -// ^ comment.line.go -meta.annotation +// ^^^^^^^^^^^^^^ comment.line.double-slash.go meta.annotation.parameters.go +// ^ comment.line.double-slash.go -meta.annotation /*line :10*/ // ^ -comment -// ^^^^^^^ comment.block.go meta.annotation.go +// ^^^^^^ comment.block.go meta.annotation.go // ^^^^ meta.variable.function.go // ^^^ comment.block.go meta.annotation.parameters.go // ^^ comment.block.go punctuation.definition.comment.end.go @@ -133,7 +144,7 @@ You may have to disable Go-specific linters when working on this file. /*line file.rl:10*/ // ^ -comment -// ^^^^^^^ comment.block.go meta.annotation.go +// ^^^^^^ comment.block.go meta.annotation.go // ^^ punctuation.definition.comment.begin.go // ^^^^ meta.variable.function.go // ^^^^^^^^^^ comment.block.go meta.annotation.parameters.go @@ -142,7 +153,7 @@ You may have to disable Go-specific linters when working on this file. /*line file.rl:100:10*/ // ^ -comment -// ^^^^^^^ comment.block.go meta.annotation.go +// ^^^^^^ comment.block.go meta.annotation.go // ^^ punctuation.definition.comment.begin.go // ^^^^ meta.variable.function.go // ^^^^^^^^^^^^^^ comment.block.go meta.annotation.parameters.go @@ -169,22 +180,22 @@ You may have to disable Go-specific linters when working on this file. //export myfunc // ^ -comment -meta -punctuation // ^^ punctuation.definition.comment.go -// ^^^^^^^^^ comment.line.go meta.annotation.go -// ^^^^^^ comment.line.go meta.annotation.parameters.go -// ^ comment.line.go -meta.annotation +// ^^^^^^^^ comment.line.double-slash.go meta.annotation.go +// ^^^^^^ comment.line.double-slash.go meta.annotation.parameters.go +// ^ comment.line.double-slash.go -meta.annotation //extern myfunc // ^ -comment -meta -punctuation // ^^ punctuation.definition.comment.go -// ^^^^^^^^^ comment.line.go meta.annotation.go -// ^^^^^^ comment.line.go meta.annotation.parameters.go -// ^ comment.line.go -meta.annotation +// ^^^^^^^^ comment.line.double-slash.go meta.annotation.go +// ^^^^^^ comment.line.double-slash.go meta.annotation.parameters.go +// ^ comment.line.double-slash.go -meta.annotation -// # Imports +/* # Imports */ package main -// ^^^^^^^ storage.type.namespace.go keyword.declaration.namespace.go +// ^^^^^^^ keyword.declaration.namespace.go // ^ - keyword - storage // ^^^^ entity.name.namespace.go @@ -208,17 +219,17 @@ You may have to disable Go-specific linters when working on this file. // ^ string.quoted.double.go punctuation.definition.string.begin.go // ^^^^^^ string.quoted.double.go // ^ string.quoted.double.go punctuation.definition.string.end.go -// ^^^^^^^^^^^ comment.line.go +// ^^^^^^^^^^^ comment.line.double-slash.go ident "module" // comment // ^^^^^ variable.other.go // ^ string.quoted.double.go punctuation.definition.string.begin.go // ^^^^^^ string.quoted.double.go // ^ string.quoted.double.go punctuation.definition.string.end.go -// ^^^^^^^^^^^ comment.line.go +// ^^^^^^^^^^^ comment.line.double-slash.go ) -// # Type Keywords and Syntax +/* # Type Keywords and Syntax */ /* Type keywords are tested early because they're used in many other tests. @@ -228,7 +239,7 @@ Note: Go permits an arbitrary number of parens around a type. Note: built-ins are tested separately. Search for "# Built-in Types". */ -// ## chan +/* ## chan */ chan _ // ^^^^ keyword.declaration.chan.go @@ -312,11 +323,10 @@ Note: built-ins are tested separately. Search for "# Built-in Types". chan // ^^^^ keyword.declaration.chan.go - ident /**/ . /**/ + ident . /**/ // ^^^^^ variable.other.go -// ^^^^ comment.block.go -// ^ punctuation.accessor.dot.go -// ^^^^ comment.block.go +// ^ punctuation.accessor.dot.go +// ^^^^ comment.block.go typ // ^^^ storage.type.go @@ -324,16 +334,14 @@ Note: built-ins are tested separately. Search for "# Built-in Types". // ^^ keyword.operator.assignment.go chan // ^^^^ keyword.declaration.chan.go - ident /**/ . /**/ + ident . /**/ // ^^^^^ variable.other.go -// ^^^^ comment.block.go -// ^ punctuation.accessor.dot.go -// ^^^^ comment.block.go - ident /**/ . /**/ +// ^ punctuation.accessor.dot.go +// ^^^^ comment.block.go + ident . /**/ // ^^^^^ variable.other.go -// ^^^^ comment.block.go -// ^ punctuation.accessor.dot.go -// ^^^^ comment.block.go +// ^ punctuation.accessor.dot.go +// ^^^^ comment.block.go typ // ^^^ storage.type.go @@ -342,16 +350,14 @@ Note: built-ins are tested separately. Search for "# Built-in Types". <- /**/ // ^^ keyword.operator.assignment.go // ^^^^ comment.block.go - ident /**/ . /**/ + ident . /**/ // ^^^^^ variable.other.go -// ^^^^ comment.block.go -// ^ punctuation.accessor.dot.go -// ^^^^ comment.block.go - ident /**/ . /**/ +// ^ punctuation.accessor.dot.go +// ^^^^ comment.block.go + ident . /**/ // ^^^^^ variable.other.go -// ^^^^ comment.block.go -// ^ punctuation.accessor.dot.go -// ^^^^ comment.block.go +// ^ punctuation.accessor.dot.go +// ^^^^ comment.block.go typ // ^^^ storage.type.go @@ -422,7 +428,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types". // ^^^ storage.type.go -// ## func +/* ## func */ // Note: a function type and the beginning of a non-method function declaration // are parsed EXACTLY the same. Function types may contain parameter names. @@ -668,17 +674,16 @@ Note: built-ins are tested separately. Search for "# Built-in Types". // ^ punctuation.separator.go /**/ // ^^^^ comment.block.go - param /**/ * /**/ ident /**/ . /**/ Type, + param /**/ * /**/ ident . /**/ Type, // ^^^^^ variable.parameter.go // ^^^^ comment.block.go // ^ keyword.operator.go // ^^^^ comment.block.go // ^^^^^ variable.other.go -// ^^^^ comment.block.go -// ^ punctuation.accessor.dot.go -// ^^^^ comment.block.go -// ^^^^ storage.type.go -// ^ punctuation.separator.go +// ^ punctuation.accessor.dot.go +// ^^^^ comment.block.go +// ^^^^ storage.type.go +// ^ punctuation.separator.go ) /**/ ( // ^ punctuation.section.parens.end.go // ^^^^ comment.block.go @@ -701,17 +706,16 @@ Note: built-ins are tested separately. Search for "# Built-in Types". // ^ punctuation.separator.go /**/ // ^^^^ comment.block.go - param /**/ * /**/ ident /**/ . /**/ Type, + param /**/ * /**/ ident . /**/ Type, // ^^^^^ variable.parameter.go // ^^^^ comment.block.go // ^ keyword.operator.go // ^^^^ comment.block.go // ^^^^^ variable.other.go -// ^^^^ comment.block.go -// ^ punctuation.accessor.dot.go -// ^^^^ comment.block.go -// ^^^^ storage.type.go -// ^ punctuation.separator.go +// ^ punctuation.accessor.dot.go +// ^^^^ comment.block.go +// ^^^^ storage.type.go +// ^ punctuation.separator.go ) // ^ punctuation.section.parens.end.go @@ -755,8 +759,429 @@ Note: built-ins are tested separately. Search for "# Built-in Types". // ^^^ storage.type.go // ^^ punctuation.section.parens.end.go + /* + Support for unions. At the time of writing, type unions are not permitted + in this position. The Go parser considers this a syntax error. However, + it's better to future-proof our syntax implementation by allowing unions + in any type position. + */ + func /**/ (param /**/ ... /**/ typ | ~typ | *typ) +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.declaration.go +// ^^^^ keyword.declaration.function.go +// ^^^^ comment.block.go +// ^^ punctuation.definition.comment.begin.go +// ^^^^^ variable.parameter.go +// ^^^^ comment.block.go +// ^^^ keyword.operator.variadic.go +// ^^^^ comment.block.go +// ^^^ storage.type.go +// ^ keyword.operator.go +// ^ keyword.operator.go +// ^^^ storage.type.go +// ^ keyword.operator.go +// ^ keyword.operator.go +// ^^^ storage.type.go +// ^ punctuation.section.parens.end.go + +/* ### Generic functions: anonymous */ + +/* +At the time of writing, Go doesn't support anonymous generic functions. +The Go parser understands them and rejects them. We may support them +by accident, but if necessary, such support could be sacrificed. +*/ + + func[TypeParam Type[TypeArg]] (param Type[TypeArg]) Type {} +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.declaration.go +// ^^^^ keyword.declaration.function.go +// ^ punctuation.section.brackets.begin.go +// ^^^^^^^^^ variable.parameter.type.go +// ^^^^ storage.type.go +// ^ punctuation.section.brackets.begin.go +// ^^^^^^^ variable.other.type.go +// ^^ punctuation.section.brackets.end.go +// ^ punctuation.section.parens.begin.go +// ^^^^^ variable.parameter.go +// ^^^^ storage.type.go +// ^ punctuation.section.brackets.begin.go +// ^^^^^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.section.parens.end.go +// ^^^^ storage.type.go +// ^^ meta.block.go +// ^ punctuation.section.braces.begin.go +// ^ punctuation.section.braces.end.go + + func[TypeParam Type[TypeArg]] (param Type[TypeArg]) Type[TypeArg] {} +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.declaration.go +// ^^^^ keyword.declaration.function.go +// ^ punctuation.section.brackets.begin.go +// ^^^^^^^^^ variable.parameter.type.go +// ^^^^ storage.type.go +// ^ punctuation.section.brackets.begin.go +// ^^^^^^^ variable.other.type.go +// ^^ punctuation.section.brackets.end.go +// ^ punctuation.section.parens.begin.go +// ^^^^^ variable.parameter.go +// ^^^^ storage.type.go +// ^ punctuation.section.brackets.begin.go +// ^^^^^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.section.parens.end.go +// ^^^^ storage.type.go +// ^ punctuation.section.brackets.begin.go +// ^^^^^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^^ meta.block.go +// ^ punctuation.section.braces.begin.go +// ^ punctuation.section.braces.end.go + + func(param Type[TypeArg]) (param Type[TypeArg]) {} +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.declaration.go +// ^^^^ keyword.declaration.function.go +// ^ punctuation.section.parens.begin.go +// ^^^^^ variable.parameter.go +// ^^^^ storage.type.go +// ^ punctuation.section.brackets.begin.go +// ^^^^^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.section.parens.end.go +// ^ punctuation.section.parens.begin.go +// ^^^^^ variable.parameter.go +// ^^^^ storage.type.go +// ^ punctuation.section.brackets.begin.go +// ^^^^^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.section.parens.end.go +// ^^ meta.block.go +// ^ punctuation.section.braces.begin.go +// ^ punctuation.section.braces.end.go + + func[TypeParam Type[TypeArg]] (param Type[TypeArg]) (param Type[TypeArg]) {} +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.declaration.go +// ^^^^ keyword.declaration.function.go +// ^ punctuation.section.brackets.begin.go +// ^^^^^^^^^ variable.parameter.type.go +// ^^^^ storage.type.go +// ^ punctuation.section.brackets.begin.go +// ^^^^^^^ variable.other.type.go +// ^^ punctuation.section.brackets.end.go +// ^ punctuation.section.parens.begin.go +// ^^^^^ variable.parameter.go +// ^^^^ storage.type.go +// ^ punctuation.section.brackets.begin.go +// ^^^^^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.section.parens.end.go +// ^ punctuation.section.parens.begin.go +// ^^^^^ variable.parameter.go +// ^^^^ storage.type.go +// ^ punctuation.section.brackets.begin.go +// ^^^^^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.section.parens.end.go +// ^^ meta.block.go +// ^ punctuation.section.braces.begin.go +// ^ punctuation.section.braces.end.go + +/* ### Generic functions: named */ + + func Func(param Type[TypeArg]) Type +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.declaration.go +// ^^^^ keyword.declaration.function.go +// ^^^^ entity.name.function.go +// ^ punctuation.section.parens.begin.go +// ^^^^^ variable.parameter.go +// ^^^^ storage.type.go +// ^ punctuation.section.brackets.begin.go +// ^^^^^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.section.parens.end.go +// ^^^^ storage.type.go + + func Func[TypeParam Type[TypeArg]] (param Type[TypeArg]) Type +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.declaration.go +// ^^^^ keyword.declaration.function.go +// ^^^^ entity.name.function.go +// ^ punctuation.section.brackets.begin.go +// ^^^^^^^^^ variable.parameter.type.go +// ^^^^ storage.type.go +// ^ punctuation.section.brackets.begin.go +// ^^^^^^^ variable.other.type.go +// ^^ punctuation.section.brackets.end.go +// ^ punctuation.section.parens.begin.go +// ^^^^^ variable.parameter.go +// ^^^^ storage.type.go +// ^ punctuation.section.brackets.begin.go +// ^^^^^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.section.parens.end.go +// ^^^^ storage.type.go + + func Func(param Type[TypeArg]) Type[TypeArg] +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.declaration.go +// ^^^^ keyword.declaration.function.go +// ^^^^ entity.name.function.go +// ^ punctuation.section.parens.begin.go +// ^^^^^ variable.parameter.go +// ^^^^ storage.type.go +// ^ punctuation.section.brackets.begin.go +// ^^^^^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.section.parens.end.go +// ^^^^ storage.type.go +// ^ punctuation.section.brackets.begin.go +// ^^^^^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go -// ## interface + func Func[TypeParam Type[TypeArg]] (param Type[TypeArg]) Type[TypeArg] +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.declaration.go +// ^^^^ keyword.declaration.function.go +// ^^^^ entity.name.function.go +// ^ punctuation.section.brackets.begin.go +// ^^^^^^^^^ variable.parameter.type.go +// ^^^^ storage.type.go +// ^ punctuation.section.brackets.begin.go +// ^^^^^^^ variable.other.type.go +// ^^ punctuation.section.brackets.end.go +// ^ punctuation.section.parens.begin.go +// ^^^^^ variable.parameter.go +// ^^^^ storage.type.go +// ^ punctuation.section.brackets.begin.go +// ^^^^^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.section.parens.end.go +// ^^^^ storage.type.go +// ^ punctuation.section.brackets.begin.go +// ^^^^^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go + + func Func(param Type[TypeArg]) (param Type[TypeArg]) +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.declaration.go +// ^^^^ keyword.declaration.function.go +// ^^^^ entity.name.function.go +// ^ punctuation.section.parens.begin.go +// ^^^^^ variable.parameter.go +// ^^^^ storage.type.go +// ^ punctuation.section.brackets.begin.go +// ^^^^^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.section.parens.end.go +// ^ punctuation.section.parens.begin.go +// ^^^^^ variable.parameter.go +// ^^^^ storage.type.go +// ^ punctuation.section.brackets.begin.go +// ^^^^^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.section.parens.end.go + + func Func[TypeParam Type[TypeArg]] (param Type[TypeArg]) (param Type[TypeArg]) {} +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.declaration.go +// ^^^^ keyword.declaration.function.go +// ^^^^ entity.name.function.go +// ^ punctuation.section.brackets.begin.go +// ^^^^^^^^^ variable.parameter.type.go +// ^^^^ storage.type.go +// ^ punctuation.section.brackets.begin.go +// ^^^^^^^ variable.other.type.go +// ^^ punctuation.section.brackets.end.go +// ^ punctuation.section.parens.begin.go +// ^^^^^ variable.parameter.go +// ^^^^ storage.type.go +// ^ punctuation.section.brackets.begin.go +// ^^^^^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.section.parens.end.go +// ^ punctuation.section.parens.begin.go +// ^^^^^ variable.parameter.go +// ^^^^ storage.type.go +// ^ punctuation.section.brackets.begin.go +// ^^^^^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.section.parens.end.go +// ^^ meta.block.go +// ^ punctuation.section.braces.begin.go +// ^ punctuation.section.braces.end.go + + func Func /**/ [ +// ^^^^^^^^^^^^^^^^ meta.function.declaration.go +// ^^^^ keyword.declaration.function.go +// ^^^^ entity.name.function.go +// ^^^^ comment.block.go +// ^^ punctuation.definition.comment.begin.go +// ^^ punctuation.definition.comment.end.go +// ^ punctuation.section.brackets.begin.go + ident /**/ ident . /**/ Ident [/**/ ident . /**/ Ident /**/], +//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.declaration.go +// ^^^^^ variable.parameter.type.go +// ^^^^ comment.block.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^ comment.block.go +// ^^^^^ storage.type.go +// ^ punctuation.section.brackets.begin.go +// ^^^^ comment.block.go +// ^^^^^ variable.other.type.go +// ^ punctuation.accessor.dot.go +// ^^^^ comment.block.go +// ^^^^^ variable.other.member.go +// ^^^^ comment.block.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.separator.go + ident /**/ ident . /**/ Ident [/**/ ident . /**/ Ident /**/], +//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.declaration.go +// ^^^^^ variable.parameter.type.go +// ^^^^ comment.block.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^ comment.block.go +// ^^^^^ storage.type.go +// ^ punctuation.section.brackets.begin.go +// ^^^^ comment.block.go +// ^^^^^ variable.other.type.go +// ^ punctuation.accessor.dot.go +// ^^^^ comment.block.go +// ^^^^^ variable.other.member.go +// ^^^^ comment.block.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.separator.go + ] ( +//^^^^^ meta.function.declaration.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.section.parens.begin.go + ident /**/ ident . /**/ Ident [/**/ ident . /**/ Ident /**/], +//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.declaration.go +// ^^^^^ variable.parameter.go +// ^^^^ comment.block.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^ comment.block.go +// ^^^^^ storage.type.go +// ^ punctuation.section.brackets.begin.go +// ^^^^ comment.block.go +// ^^^^^ variable.other.type.go +// ^ punctuation.accessor.dot.go +// ^^^^ comment.block.go +// ^^^^^ variable.other.member.go +// ^^^^ comment.block.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.separator.go + ident /**/ ident . /**/ Ident [/**/ ident . /**/ Ident /**/], +//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.declaration.go +// ^^^^^ variable.parameter.go +// ^^^^ comment.block.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^ comment.block.go +// ^^^^^ storage.type.go +// ^ punctuation.section.brackets.begin.go +// ^^^^ comment.block.go +// ^^^^^ variable.other.type.go +// ^ punctuation.accessor.dot.go +// ^^^^ comment.block.go +// ^^^^^ variable.other.member.go +// ^^^^ comment.block.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.separator.go + ) ( +//^^^^^ meta.function.declaration.go +// ^ punctuation.section.parens.end.go +// ^ punctuation.section.parens.begin.go + ident /**/ ident . /**/ Ident [/**/ ident . /**/ Ident /**/], +//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.declaration.go +// ^^^^^ variable.parameter.go +// ^^^^ comment.block.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^ comment.block.go +// ^^^^^ storage.type.go +// ^ punctuation.section.brackets.begin.go +// ^^^^ comment.block.go +// ^^^^^ variable.other.type.go +// ^ punctuation.accessor.dot.go +// ^^^^ comment.block.go +// ^^^^^ variable.other.member.go +// ^^^^ comment.block.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.separator.go + ident /**/ ident . /**/ Ident [/**/ ident . /**/ Ident /**/], +//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.declaration.go +// ^^^^^ variable.parameter.go +// ^^^^ comment.block.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^ comment.block.go +// ^^^^^ storage.type.go +// ^ punctuation.section.brackets.begin.go +// ^^^^ comment.block.go +// ^^^^^ variable.other.type.go +// ^ punctuation.accessor.dot.go +// ^^^^ comment.block.go +// ^^^^^ variable.other.member.go +// ^^^^ comment.block.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.separator.go + ) +//^^^ meta.function.declaration.go +// ^ punctuation.section.parens.end.go + +/* ### Generic functions: methods */ + + func(param Type[TypeArg]) Func(param Type[TypeArg]) Type +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.declaration.go +// ^^^^ keyword.declaration.function.go +// ^ punctuation.section.parens.begin.go +// ^^^^^ variable.parameter.go +// ^^^^ storage.type.go +// ^ punctuation.section.brackets.begin.go +// ^^^^^^^ variable.parameter.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.section.parens.end.go +// ^^^^ entity.name.function.go +// ^ punctuation.section.parens.begin.go +// ^^^^^ variable.parameter.go +// ^^^^ storage.type.go +// ^ punctuation.section.brackets.begin.go +// ^^^^^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.section.parens.end.go +// ^^^^ storage.type.go +// ^ -meta.function.declaration.go + + func(ident ident[ident, ident]) ident(ident ident[ident, ident]) (ident ident[ident, ident]) +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.declaration.go +// ^^^^ keyword.declaration.function.go +// ^ punctuation.section.parens.begin.go +// ^^^^^ variable.parameter.go +// ^^^^^ storage.type.go +// ^ punctuation.section.brackets.begin.go +// ^^^^^ variable.parameter.type.go +// ^ punctuation.separator.go +// ^^^^^ variable.parameter.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.section.parens.end.go +// ^^^^^ entity.name.function.go +// ^ punctuation.section.parens.begin.go +// ^^^^^ variable.parameter.go +// ^^^^^ storage.type.go +// ^ punctuation.section.brackets.begin.go +// ^^^^^ variable.other.type.go +// ^ punctuation.separator.go +// ^^^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.section.parens.end.go +// ^ punctuation.section.parens.begin.go +// ^^^^^ variable.parameter.go +// ^^^^^ storage.type.go +// ^ punctuation.section.brackets.begin.go +// ^^^^^ variable.other.type.go +// ^ punctuation.separator.go +// ^^^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.section.parens.end.go +// ^ -meta.function.declaration.go + +/* ## interface */ interface{} // ^^^^^^^^^ keyword.declaration.interface.go @@ -787,20 +1212,20 @@ Note: built-ins are tested separately. Search for "# Built-in Types". // ^ meta.type.go punctuation.section.parens.end.go Inherit -// ^^^^^^^ meta.type.go entity.other.inherited-class.go +// ^^^^^^^ meta.type.go storage.type.go *ident.Inherit // ^ meta.type.go keyword.operator.go // ^^^^^ meta.type.go variable.other.go // ^ meta.type.go punctuation.accessor.dot.go -// ^^^^^^^ meta.type.go entity.other.inherited-class.go +// ^^^^^^^ meta.type.go storage.type.go Inherit // comment -// ^^^^^^^ meta.type.go entity.other.inherited-class.go -// ^^^^^^^^^^^ meta.type.go comment.line.go +// ^^^^^^^ meta.type.go storage.type.go +// ^^^^^^^^^^^ meta.type.go comment.line.double-slash.go Inherit /* comment */ -// ^^^^^^^ meta.type.go entity.other.inherited-class.go +// ^^^^^^^ meta.type.go storage.type.go // ^^^^^^^^^^^^^ meta.type.go comment.block.go Method( @@ -816,18 +1241,16 @@ Note: built-ins are tested separately. Search for "# Built-in Types". // ^ meta.type.go punctuation.accessor.dot.go // ^^^^^ meta.type.go variable.other.go // ^ meta.type.go punctuation.accessor.dot.go -// ^^^^^^^ meta.type.go entity.other.inherited-class.go +// ^^^^^^^ meta.type.go storage.type.go - ident /**/ . + ident . // ^^^^^ meta.type.go variable.other.go -// ^^^^ meta.type.go comment.block.go -// ^ meta.type.go punctuation.accessor.dot.go - ident /**/ . +// ^ meta.type.go punctuation.accessor.dot.go + ident . // ^^^^^ meta.type.go variable.other.go -// ^^^^ meta.type.go comment.block.go -// ^ meta.type.go punctuation.accessor.dot.go +// ^ meta.type.go punctuation.accessor.dot.go Inherit -// ^^^^^^^ meta.type.go entity.other.inherited-class.go +// ^^^^^^^ meta.type.go storage.type.go } // ^ meta.type.go punctuation.section.braces.end.go @@ -842,7 +1265,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types". // ^ meta.type.go punctuation.section.parens.end.go // ^^^ meta.type.go storage.type.go // ^ meta.type.go punctuation.terminator.go -// ^^^^^^^ meta.type.go entity.other.inherited-class.go +// ^^^^^^^ meta.type.go storage.type.go // ^ meta.type.go punctuation.terminator.go // ^^^^^^ meta.type.go entity.name.function.go // ^ meta.type.go punctuation.section.parens.begin.go @@ -853,8 +1276,51 @@ Note: built-ins are tested separately. Search for "# Built-in Types". // ^ meta.type.go punctuation.terminator.go // ^ meta.type.go punctuation.section.braces.end.go + interface{~ident} +// ^^^^^^^^^ keyword.declaration.interface.go +// ^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^ keyword.operator.go +// ^^^^^ storage.type.go +// ^ punctuation.section.braces.end.go -// ## map + interface{one|two|three} +// ^^^^^^^^^ keyword.declaration.interface.go +// ^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^ storage.type.go +// ^ keyword.operator.go +// ^^^ storage.type.go +// ^ keyword.operator.go +// ^^^^^ storage.type.go +// ^ punctuation.section.braces.end.go + + interface{~one|~two|~three} +// ^^^^^^^^^ keyword.declaration.interface.go +// ^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^ keyword.operator.go +// ^^^ storage.type.go +// ^ keyword.operator.go +// ^ keyword.operator.go +// ^^^ storage.type.go +// ^ keyword.operator.go +// ^ keyword.operator.go +// ^^^^^ storage.type.go +// ^ punctuation.section.braces.end.go + + interface{ + one | +// ^^^ storage.type.go +// ^ keyword.operator.go + // comment +// ^^^^^^^^^^ comment.line.double-slash.go +// ^^ punctuation.definition.comment.go + two +// ^^^ storage.type.go + } + +/* ## map */ map[typ]typ // ^^^ keyword.declaration.map.go @@ -871,12 +1337,6 @@ Note: built-ins are tested separately. Search for "# Built-in Types". // ^^^ storage.type.go // ^^^^^ variable.other.go -storage - map[typ] -// ^^^ keyword.declaration.map.go -// ^^^ storage.type.go - ident -// ^^^^^ variable.other.go - map /**/ [/**/ typ /**/] /**/ typ // ^^^ keyword.declaration.map.go // ^^^^ comment.block.go @@ -888,20 +1348,23 @@ Note: built-ins are tested separately. Search for "# Built-in Types". // ^^^^ comment.block.go // ^^^ storage.type.go - map /**/ + map // ^^^ keyword.declaration.map.go -// ^^^^ comment.block.go - /**/ [ /**/ + /**/ // ^^^^ comment.block.go -// ^ punctuation.section.brackets.begin.go -// ^^^^ comment.block.go - /**/ typ /**/ ] /**/ typ + [ +// ^ punctuation.section.brackets.begin.go + /**/ +// ^^^^ comment.block.go + typ +// ^^^ storage.type.go + /**/ +// ^^^^ comment.block.go + ] + /**/ // ^^^^ comment.block.go -// ^^^ storage.type.go -// ^^^^ comment.block.go -// ^ punctuation.section.brackets.end.go -// ^^^^ comment.block.go -// ^^^ storage.type.go + typ +// ^^^ storage.type.go map[typ]map[typ]map[typ]map[typ]typ // ^^^ keyword.declaration.map.go @@ -995,18 +1458,16 @@ Note: built-ins are tested separately. Search for "# Built-in Types". // ^ punctuation.accessor.dot.go // ^^^^ storage.type.go - map[typ]ident /**/ . /**/ + map[typ]ident . /**/ // ^^^ keyword.declaration.map.go // ^^^ storage.type.go // ^^^^^ variable.other.go -// ^^^^ comment.block.go -// ^ punctuation.accessor.dot.go -// ^^^^ comment.block.go - ident /**/ . /**/ +// ^ punctuation.accessor.dot.go +// ^^^^ comment.block.go + ident . /**/ // ^^^^^ variable.other.go -// ^^^^ comment.block.go -// ^ punctuation.accessor.dot.go -// ^^^^ comment.block.go +// ^ punctuation.accessor.dot.go +// ^^^^ comment.block.go typ // ^^^ storage.type.go @@ -1030,7 +1491,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types". // ^^^ storage.type.go -// ## struct +/* ## struct */ struct{} // ^^^^^^ keyword.declaration.struct.go @@ -1081,26 +1542,26 @@ Note: built-ins are tested separately. Search for "# Built-in Types". field typ `json:"field"` // ^^^^^ meta.type.go variable.other.member.declaration.go // ^^^ meta.type.go storage.type.go -// ^^^^^^^^^^^^^^ meta.type.go string.quoted.other.go +// ^^^^^^^^^^^^^^ meta.type.go string.quoted.backtick.go field /**/ typ /**/ `json:"field"` // ^^^^^ meta.type.go variable.other.member.declaration.go // ^^^^ meta.type.go comment.block.go // ^^^ meta.type.go storage.type.go // ^^^^ meta.type.go comment.block.go -// ^^^^^^^^^^^^^^ meta.type.go string.quoted.other.go +// ^^^^^^^^^^^^^^ meta.type.go string.quoted.backtick.go typ `json:"-"` // ^^^ meta.type.go entity.other.inherited-class.go -// ^^^^^^^^^^ meta.type.go string.quoted.other.go +// ^^^^^^^^^^ meta.type.go string.quoted.backtick.go typ /**/ `json:"-"` // ^^^ meta.type.go entity.other.inherited-class.go // ^^^^ meta.type.go comment.block.go -// ^^^^^^^^^^ meta.type.go string.quoted.other.go +// ^^^^^^^^^^ meta.type.go string.quoted.backtick.go typ // ^^^ meta.type.go entity.other.inherited-class.go typ // comment // ^^^ meta.type.go entity.other.inherited-class.go -// ^^^^^^^^^^^ meta.type.go comment.line.go +// ^^^^^^^^^^^ meta.type.go comment.line.double-slash.go typ /* comment */ // ^^^ meta.type.go entity.other.inherited-class.go @@ -1143,30 +1604,26 @@ Note: built-ins are tested separately. Search for "# Built-in Types". // ^ meta.type.go punctuation.section.braces.end.go struct { - ** /**/ ident /**/ . /**/ ident /**/ . /**/ embed + ** /**/ ident . /**/ ident . /**/ embed // ^^ meta.type.go keyword.operator.go // ^^^^ meta.type.go comment.block.go // ^^^^^ meta.type.go variable.other.go -// ^^^^ meta.type.go comment.block.go -// ^ meta.type.go punctuation.accessor.dot.go -// ^^^^ meta.type.go comment.block.go -// ^^^^^ meta.type.go variable.other.go -// ^^^^ meta.type.go comment.block.go -// ^ meta.type.go punctuation.accessor.dot.go -// ^^^^ meta.type.go comment.block.go -// ^^^^^ meta.type.go entity.other.inherited-class.go - - ** ident /**/ . /**/ -// ^^ meta.type.go keyword.operator.go -// ^^^^^ meta.type.go variable.other.go -// ^^^^ meta.type.go comment.block.go // ^ meta.type.go punctuation.accessor.dot.go // ^^^^ meta.type.go comment.block.go - ident /**/ . /**/ +// ^^^^^ meta.type.go variable.other.go +// ^ meta.type.go punctuation.accessor.dot.go +// ^^^^ meta.type.go comment.block.go +// ^^^^^ meta.type.go entity.other.inherited-class.go + + ** ident . /**/ +// ^^ meta.type.go keyword.operator.go // ^^^^^ meta.type.go variable.other.go -// ^^^^ meta.type.go comment.block.go -// ^ meta.type.go punctuation.accessor.dot.go -// ^^^^ meta.type.go comment.block.go +// ^ meta.type.go punctuation.accessor.dot.go +// ^^^^ meta.type.go comment.block.go + ident . /**/ +// ^^^^^ meta.type.go variable.other.go +// ^ meta.type.go punctuation.accessor.dot.go +// ^^^^ meta.type.go comment.block.go embed // ^^^^^ meta.type.go entity.other.inherited-class.go } @@ -1271,34 +1728,1365 @@ Note: built-ins are tested separately. Search for "# Built-in Types". embed // ^^^^^ meta.type.go entity.other.inherited-class.go - field interface{ -// ^^^^^ meta.type.go variable.other.member.declaration.go -// ^^^^^^^^^ meta.type.go keyword.declaration.interface.go - method() -// ^^^^^^ meta.type.go meta.type.go entity.name.function.go - } + field interface{ +// ^^^^^ meta.type.go variable.other.member.declaration.go +// ^^^^^^^^^ meta.type.go keyword.declaration.interface.go + method() +// ^^^^^^ meta.type.go meta.type.go entity.name.function.go + } + + embed +// ^^^^^ meta.type.go entity.other.inherited-class.go + + field struct{ +// ^^^^^ meta.type.go variable.other.member.declaration.go +// ^^^^^^ meta.type.go keyword.declaration.struct.go + field typ +// ^^^^^ meta.type.go meta.type.go variable.other.member.declaration.go +// ^^^ meta.type.go meta.type.go storage.type.go + } + + field [0]typ +// ^^^^^ meta.type.go variable.other.member.declaration.go +// ^ meta.type.go punctuation.section.brackets.begin.go +// ^ meta.type.go meta.number.integer.decimal.go constant.numeric.value.go +// ^ meta.type.go punctuation.section.brackets.end.go +// ^^^ meta.type.go storage.type.go + } + +/* ### Embedded parametrized types */ + + struct{ embed[typ] } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.section.braces.end.go + + struct{ embed[typ]; } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.terminator.go +// ^ punctuation.section.braces.end.go + + struct{ embed[typ] `tag` } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.section.braces.end.go + + struct{ embed[typ] `tag`; } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^ punctuation.section.braces.end.go + + struct{ embed[typ]; field typ } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^ punctuation.section.braces.end.go + + struct{ embed[typ]; field typ;} +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^ punctuation.terminator.go +// ^ punctuation.section.braces.end.go + + struct{ embed[typ]; field typ `tag` } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.section.braces.end.go + + struct{ embed[typ]; field typ `tag`; } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^ punctuation.section.braces.end.go + + struct{ embed[typ] `tag`; field typ } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^ punctuation.section.braces.end.go + + struct{ embed[typ] `tag`; field typ;} +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^ punctuation.terminator.go +// ^ punctuation.section.braces.end.go + + struct{ embed[typ] `tag`; field typ `tag` } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.section.braces.end.go + + struct{ embed[typ] `tag`; field typ `tag`; } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^ punctuation.section.braces.end.go + + struct{ ident.embed[typ] } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.section.braces.end.go + + struct{ ident.embed[typ]; } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.terminator.go +// ^ punctuation.section.braces.end.go + + struct{ ident.embed[typ] `tag` } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.section.braces.end.go + + struct{ ident.embed[typ] `tag`; } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^ punctuation.section.braces.end.go + + struct{ ident.embed[typ]; field typ } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^ punctuation.section.braces.end.go + + struct{ ident.embed[typ]; field typ;} +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^ punctuation.terminator.go +// ^ punctuation.section.braces.end.go + + struct{ ident.embed[typ]; field typ `tag` } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.section.braces.end.go + + struct{ ident.embed[typ]; field typ `tag`; } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^ punctuation.section.braces.end.go + + struct{ ident.embed[typ] `tag`; field typ } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^ punctuation.section.braces.end.go + + struct{ ident.embed[typ] `tag`; field typ;} +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^ punctuation.terminator.go +// ^ punctuation.section.braces.end.go + + struct{ ident.embed[typ] `tag`; field typ `tag` } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.section.braces.end.go + + struct{ ident.embed[typ] `tag`; field typ `tag`; } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^ punctuation.section.braces.end.go + + struct{ field typ; embed[typ] } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^ punctuation.terminator.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.section.braces.end.go + + struct{ field typ; embed[typ]; } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^ punctuation.terminator.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.terminator.go +// ^ punctuation.section.braces.end.go + + struct{ field typ; embed[typ] `tag` } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^ punctuation.terminator.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.section.braces.end.go + + struct{ field typ; embed[typ] `tag`; } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^ punctuation.terminator.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^ punctuation.section.braces.end.go + + struct{ field typ; embed[typ]; field typ } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^ punctuation.terminator.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^ punctuation.section.braces.end.go + + struct{ field typ; embed[typ]; field typ;} +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^ punctuation.terminator.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^ punctuation.terminator.go +// ^ punctuation.section.braces.end.go + + struct{ field typ; embed[typ]; field typ `tag` } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^ punctuation.terminator.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.section.braces.end.go + + struct{ field typ; embed[typ]; field typ `tag`; } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^ punctuation.terminator.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^ punctuation.section.braces.end.go + + struct{ field typ; embed[typ] `tag`; field typ } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^ punctuation.terminator.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^ punctuation.section.braces.end.go + + struct{ field typ; embed[typ] `tag`; field typ;} +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^ punctuation.terminator.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^ punctuation.terminator.go +// ^ punctuation.section.braces.end.go + + struct{ field typ; embed[typ] `tag`; field typ `tag` } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^ punctuation.terminator.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.section.braces.end.go + + struct{ field typ; embed[typ] `tag`; field typ `tag`; } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^ punctuation.terminator.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^ punctuation.section.braces.end.go + + struct{ field typ `tag`; embed[typ] } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.section.braces.end.go + + struct{ field typ `tag`; embed[typ]; } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.terminator.go +// ^ punctuation.section.braces.end.go + + struct{ field typ `tag`; embed[typ] `tag` } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.section.braces.end.go + + struct{ field typ `tag`; embed[typ] `tag`; } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^ punctuation.section.braces.end.go + + struct{ field typ `tag`; embed[typ]; field typ } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^ punctuation.section.braces.end.go + + struct{ field typ `tag`; embed[typ]; field typ;} +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^ punctuation.terminator.go +// ^ punctuation.section.braces.end.go + + struct{ field typ `tag`; embed[typ]; field typ `tag` } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.section.braces.end.go + + struct{ field typ `tag`; embed[typ]; field typ `tag`; } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^ punctuation.section.braces.end.go + + struct{ field typ `tag`; embed[typ] `tag`; field typ } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^ punctuation.section.braces.end.go + + struct{ field typ `tag`; embed[typ] `tag`; field typ;} +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^ punctuation.terminator.go +// ^ punctuation.section.braces.end.go + + struct{ field typ `tag`; embed[typ] `tag`; field typ `tag` } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.section.braces.end.go + + struct{ field typ `tag`; embed[typ] `tag`; field typ `tag`; } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^ punctuation.section.braces.end.go + + struct{ field typ `tag`; ident.embed[typ] } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.section.braces.end.go + + struct{ field typ `tag`; ident.embed[typ]; } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.terminator.go +// ^ punctuation.section.braces.end.go + + struct{ field typ `tag`; ident.embed[typ] `tag` } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.section.braces.end.go + + struct{ field typ `tag`; ident.embed[typ] `tag`; } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^ punctuation.section.braces.end.go + + struct{ field typ `tag`; ident.embed[typ]; field typ } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^ punctuation.section.braces.end.go + + struct{ field typ `tag`; ident.embed[typ]; field typ;} +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^ punctuation.terminator.go +// ^ punctuation.section.braces.end.go + + struct{ field typ `tag`; ident.embed[typ]; field typ `tag` } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.section.braces.end.go + + struct{ field typ `tag`; ident.embed[typ]; field typ `tag`; } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^ punctuation.section.braces.end.go + + struct{ field typ `tag`; ident.embed[typ] `tag`; field typ } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^ punctuation.section.braces.end.go + + struct{ field typ `tag`; ident.embed[typ] `tag`; field typ;} +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^ punctuation.terminator.go +// ^ punctuation.section.braces.end.go + + struct{ field typ `tag`; ident.embed[typ] `tag`; field typ `tag` } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.section.braces.end.go + + struct{ field typ `tag`; ident.embed[typ] `tag`; field typ `tag`; } +// ^^^^^^ keyword.declaration.struct.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^ punctuation.section.braces.end.go + + struct { +// ^^^^^^ keyword.declaration.struct.go +// ^ meta.type.go punctuation.section.braces.begin.go + embed[typ] +//^^^^^^^^^^^^^^^^ meta.type.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go + embed[typ, typ] +//^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.separator.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go + embed[typ] `` +//^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go + embed /**/ [typ] +//^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^^^^^ entity.other.inherited-class.go +// ^^^^ comment.block.go +// ^^ punctuation.definition.comment.begin.go +// ^^ punctuation.definition.comment.end.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go + embed /**/ [typ] `` +//^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^^^^^ entity.other.inherited-class.go +// ^^^^ comment.block.go +// ^^ punctuation.definition.comment.begin.go +// ^^ punctuation.definition.comment.end.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go + embed /**/ [typ] /**/ +//^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^^^^^ entity.other.inherited-class.go +// ^^^^ comment.block.go +// ^^ punctuation.definition.comment.begin.go +// ^^ punctuation.definition.comment.end.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^^^^ comment.block.go +// ^^ punctuation.definition.comment.begin.go +// ^^ punctuation.definition.comment.end.go + embed /**/ [typ] /**/ `` +//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^^^^^ entity.other.inherited-class.go +// ^^^^ comment.block.go +// ^^ punctuation.definition.comment.begin.go +// ^^ punctuation.definition.comment.end.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^^^^ comment.block.go +// ^^ punctuation.definition.comment.begin.go +// ^^ punctuation.definition.comment.end.go +// ^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go + embed /**/ [typ] ; field typ +//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^^^^^ entity.other.inherited-class.go +// ^^^^ comment.block.go +// ^^ punctuation.definition.comment.begin.go +// ^^ punctuation.definition.comment.end.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go + embed /**/ [typ] /**/; field typ +//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^^^^^ entity.other.inherited-class.go +// ^^^^ comment.block.go +// ^^ punctuation.definition.comment.begin.go +// ^^ punctuation.definition.comment.end.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^^^^ comment.block.go +// ^^ punctuation.definition.comment.begin.go +// ^^ punctuation.definition.comment.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go + embed /**/ [typ] /**/ ``; field typ +//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^^^^^ entity.other.inherited-class.go +// ^^^^ comment.block.go +// ^^ punctuation.definition.comment.begin.go +// ^^ punctuation.definition.comment.end.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^^^^ comment.block.go +// ^^ punctuation.definition.comment.begin.go +// ^^ punctuation.definition.comment.end.go +// ^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go +// ^ punctuation.terminator.go +// ^^^^^ variable.other.member.declaration.go +// ^^^ storage.type.go + field /**/ [] /**/ typ +//^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^^^^^ variable.other.member.declaration.go +// ^^^^ comment.block.go +// ^^ punctuation.definition.comment.begin.go +// ^^ punctuation.definition.comment.end.go +// ^ punctuation.section.brackets.begin.go +// ^ punctuation.section.brackets.end.go +// ^^^^ comment.block.go +// ^^ punctuation.definition.comment.begin.go +// ^^ punctuation.definition.comment.end.go +// ^^^ storage.type.go + field /**/ [size] /**/ typ +//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^^^^^ variable.other.member.declaration.go +// ^^^^ comment.block.go +// ^^ punctuation.definition.comment.begin.go +// ^^ punctuation.definition.comment.end.go +// ^ punctuation.section.brackets.begin.go +// ^^^^ variable.other.go +// ^ punctuation.section.brackets.end.go +// ^^^^ comment.block.go +// ^^ punctuation.definition.comment.begin.go +// ^^ punctuation.definition.comment.end.go +// ^^^ storage.type.go + field /**/ [size] /**/ typ `tag` +//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^^^^^ variable.other.member.declaration.go +// ^^^^ comment.block.go +// ^^ punctuation.definition.comment.begin.go +// ^^ punctuation.definition.comment.end.go +// ^ punctuation.section.brackets.begin.go +// ^^^^ variable.other.go +// ^ punctuation.section.brackets.end.go +// ^^^^ comment.block.go +// ^^ punctuation.definition.comment.begin.go +// ^^ punctuation.definition.comment.end.go +// ^^^ storage.type.go +// ^^^^^ string.quoted.backtick.go +// ^ punctuation.definition.string.begin.go +// ^ punctuation.definition.string.end.go + } +//^^^ meta.type.go +// ^ punctuation.section.braces.end.go - embed -// ^^^^^ meta.type.go entity.other.inherited-class.go + struct {_} +// ^^^^^^ keyword.declaration.struct.go +// ^^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^ variable.language.anonymous.go +// ^ punctuation.section.braces.end.go - field struct{ -// ^^^^^ meta.type.go variable.other.member.declaration.go -// ^^^^^^ meta.type.go keyword.declaration.struct.go - field typ -// ^^^^^ meta.type.go meta.type.go variable.other.member.declaration.go -// ^^^ meta.type.go meta.type.go storage.type.go - } + struct { + _[typ] +//^^^^^^^^^^^^ meta.type.go +// ^ variable.language.anonymous.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go + } - field [0]typ -// ^^^^^ meta.type.go variable.other.member.declaration.go -// ^ meta.type.go punctuation.section.brackets.begin.go -// ^ meta.type.go meta.number.integer.decimal.go constant.numeric.value.go -// ^ meta.type.go punctuation.section.brackets.end.go -// ^^^ meta.type.go storage.type.go + struct { + *ident.embed[typ] +//^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^ keyword.operator.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ entity.other.inherited-class.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go } + /* + Known defect. This should be scoped as an embedded type. + The current implementation incorrectly scopes this as a field. + TODO improve. + */ + struct { + embed[struct{ + }] + } -// ## Array / Slice +/* ## Array / Slice */ [0]typ // ^ punctuation.section.brackets.begin.go @@ -1381,7 +3169,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types". // ^^^^^ variable.other.go -// ## type +/* ## type */ type _ typ // ^^^^ keyword.declaration.type.go @@ -1397,7 +3185,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types". // ^^^^ keyword.declaration.type.go /**/ // ^^^^ comment.block.go - Type /**/ * /**/ * /**/ ident /**/ . /**/ + Type /**/ * /**/ * /**/ ident . /**/ // ^^^^ entity.name.type.go // ^^^^ comment.block.go // ^ keyword.operator.go @@ -1405,15 +3193,13 @@ Note: built-ins are tested separately. Search for "# Built-in Types". // ^ keyword.operator.go // ^^^^ comment.block.go // ^^^^^ variable.other.go -// ^^^^ comment.block.go -// ^ punctuation.accessor.dot.go -// ^^^^ comment.block.go - /**/ ident /**/ . /**/ +// ^ punctuation.accessor.dot.go +// ^^^^ comment.block.go + /**/ ident . /**/ // ^^^^ comment.block.go // ^^^^^ variable.other.go -// ^^^^ comment.block.go -// ^ punctuation.accessor.dot.go -// ^^^^ comment.block.go +// ^ punctuation.accessor.dot.go +// ^^^^ comment.block.go /**/ Type // ^^^^ comment.block.go // ^^^^ storage.type.go @@ -1485,7 +3271,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types". Method() // ^^^^^^ meta.type.go entity.name.function.go Inherit -// ^^^^^^^ meta.type.go entity.other.inherited-class.go +// ^^^^^^^ meta.type.go storage.type.go } ident // ^^^^^ variable.other.go @@ -1546,8 +3332,364 @@ Note: built-ins are tested separately. Search for "# Built-in Types". } ) + /* + Support for unions. + + At the time of writing, unions are allowed only in interfaces (called + "general" interfaces as opposed to "basic" interfaces which contain only + methods), and in constraints for type parameters, where a union is + considered a shorthand for a general interface. Unions in RHS of type + definitions are not yet allowed. However, for us, it's easier to support + unions in all type contexts. + */ + type Ident Ident | ~Ident | *Ident +// ^^^^ keyword.declaration.type.go +// ^^^^^ entity.name.type.go +// ^^^^^ storage.type.go +// ^ keyword.operator.go +// ^ keyword.operator.go +// ^^^^^ storage.type.go +// ^ keyword.operator.go +// ^ keyword.operator.go +// ^^^^^ storage.type.go + + type Ident = Ident | ~Ident | *Ident +// ^^^^ keyword.declaration.type.go +// ^^^^^ entity.name.type.go +// ^ keyword.operator.assignment.go +// ^^^^^ storage.type.go +// ^ keyword.operator.go +// ^ keyword.operator.go +// ^^^^^ storage.type.go +// ^ keyword.operator.go +// ^ keyword.operator.go +// ^^^^^ storage.type.go + + /* + Sanity check. This looks similar to a parametrized type, but in fact defines + an array type. + */ + type Type[ident] ident +// ^^^^ keyword.declaration.type.go +// ^^^^ entity.name.type.go +// ^ punctuation.section.brackets.begin.go +// ^^^^^ variable.other.go +// ^ punctuation.section.brackets.end.go +// ^^^^^ storage.type.go + + // Same as above. This is NOT a parametrized type. + type Type[_] ident +// ^^^^ keyword.declaration.type.go +// ^^^^ entity.name.type.go +// ^ punctuation.section.brackets.begin.go +// ^ variable.language.anonymous.go +// ^ punctuation.section.brackets.end.go +// ^^^^^ storage.type.go + + /* + Parsing ambiguity. Can be interpreted as: + + * Parametrized typedef of "C" where "A" is a type parameter and "*B" is + a type constraint. + + * Non-parametrized typedef of array of "C" where "A * B" is a constant + expression that defines array size. + + For backwards compatibility, Go resolves such ambiguities in favor of + constant expressions and arrays, rather than type parameter lists. + We must match this behavior. + */ + type Type [A * B] C +// ^^^^ keyword.declaration.type.go +// ^^^^ entity.name.type.go +// ^ punctuation.section.brackets.begin.go +// ^ variable.other.go +// ^ keyword.operator.go +// ^ variable.other.go +// ^ punctuation.section.brackets.end.go +// ^ storage.type.go + + /* + Known issue. + + This type parameter list is disambiguated from a fixed-size array definition + by the trailing comma. This is part of the official documentation and is + specifically supported by the Go parser and `gofmt`. + + Our current implementation doesn't support this case. + TODO consider fixing. + */ + type Type [A * B,] C +// ^^^^ keyword.declaration.type.go +// ^^^^ entity.name.type.go +// ^ punctuation.section.brackets.begin.go +// ^ keyword.operator.go +// ^ punctuation.separator.go +// ^ punctuation.section.brackets.end.go +// ^ storage.type.go + + type Ident [Ident Ident] Ident +// ^^^^ keyword.declaration.type.go +// ^^^^^ entity.name.type.go +// ^ punctuation.section.brackets.begin.go +// ^^^^^ variable.parameter.type.go +// ^^^^^ storage.type.go +// ^ punctuation.section.brackets.end.go +// ^^^^^ storage.type.go + + type Ident [Ident, Ident Ident] ident.Ident +// ^^^^ keyword.declaration.type.go +// ^^^^^ entity.name.type.go +// ^ punctuation.section.brackets.begin.go +// ^^^^^ variable.parameter.type.go +// ^ punctuation.separator.go +// ^^^^^ variable.parameter.type.go +// ^^^^^ storage.type.go +// ^ punctuation.section.brackets.end.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ storage.type.go + + type ( + Ident [Ident Ident] Ident +// ^^^^^ entity.name.type.go +// ^ punctuation.section.brackets.begin.go +// ^^^^^ variable.parameter.type.go +// ^^^^^ storage.type.go +// ^ punctuation.section.brackets.end.go +// ^^^^^ storage.type.go + + Ident [Ident ident.Ident] ident.Ident +// ^^^^^ entity.name.type.go +// ^ punctuation.section.brackets.begin.go +// ^^^^^ variable.parameter.type.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ storage.type.go +// ^ punctuation.section.brackets.end.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ storage.type.go + ) + + type Ident [ +// ^^^^ keyword.declaration.type.go +// ^^^^^ entity.name.type.go +// ^ punctuation.section.brackets.begin.go + Ident Ident, +// ^^^^^ variable.parameter.type.go +// ^^^^^ storage.type.go +// ^ punctuation.separator.go + ] Ident +// ^ punctuation.section.brackets.end.go +// ^^^^^ storage.type.go + + type Ident [ +// ^^^^ keyword.declaration.type.go +// ^^^^^ entity.name.type.go +// ^ punctuation.section.brackets.begin.go + Ident ident.Ident, +// ^^^^^ variable.parameter.type.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ storage.type.go +// ^ punctuation.separator.go + ] ident.Ident +// ^ punctuation.section.brackets.end.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ storage.type.go + + type Ident [ +// ^^^^ keyword.declaration.type.go +// ^^^^^ entity.name.type.go +// ^ punctuation.section.brackets.begin.go + Ident, +// ^^^^^ variable.parameter.type.go +// ^ punctuation.separator.go + Ident ident.Ident, +// ^^^^^ variable.parameter.type.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ storage.type.go + ] ident.Ident +// ^ punctuation.section.brackets.end.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ storage.type.go + + type Ident [ +// ^^^^ keyword.declaration.type.go +// ^^^^^ entity.name.type.go +// ^ punctuation.section.brackets.begin.go + Ident, Ident ident.Ident, +// ^^^^^ variable.parameter.type.go +// ^ punctuation.separator.go +// ^^^^^ variable.parameter.type.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ storage.type.go +// ^ punctuation.separator.go + ] ident.Ident +// ^ punctuation.section.brackets.end.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ storage.type.go + + type Ident [Ident ~Ident] Ident +// ^^^^ keyword.declaration.type.go +// ^^^^^ entity.name.type.go +// ^ punctuation.section.brackets.begin.go +// ^^^^^ variable.parameter.type.go +// ^ keyword.operator.go +// ^^^^^ storage.type.go +// ^ punctuation.section.brackets.end.go +// ^^^^^ storage.type.go + + type Ident [Ident ~ident.Ident] ident.Ident +// ^^^^ keyword.declaration.type.go +// ^^^^^ entity.name.type.go +// ^ punctuation.section.brackets.begin.go +// ^^^^^ variable.parameter.type.go +// ^ keyword.operator.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ storage.type.go +// ^ punctuation.section.brackets.end.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ storage.type.go + + type Ident [ +// ^^^^ keyword.declaration.type.go +// ^^^^^ entity.name.type.go +// ^ punctuation.section.brackets.begin.go + Ident ~ident.Ident, +// ^^^^^ variable.parameter.type.go +// ^ keyword.operator.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ storage.type.go +// ^ punctuation.separator.go + ] ident.Ident +// ^ punctuation.section.brackets.end.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ storage.type.go + + type Ident [Ident []ident.Ident] ident.Ident + + type Ident [Ident [ident.Ident] ident.Ident] ident.Ident +// ^^^^ keyword.declaration.type.go +// ^^^^^ entity.name.type.go +// ^ punctuation.section.brackets.begin.go +// ^^^^^ variable.parameter.type.go +// ^ punctuation.section.brackets.begin.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ variable.other.member.go +// ^ punctuation.section.brackets.end.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ storage.type.go +// ^ punctuation.section.brackets.end.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ storage.type.go + + type Ident [Ident struct{}] ident.Ident +// ^^^^ keyword.declaration.type.go +// ^^^^^ entity.name.type.go +// ^ punctuation.section.brackets.begin.go +// ^^^^^ variable.parameter.type.go +// ^^^^^^ keyword.declaration.struct.go +// ^^ meta.type.go +// ^ punctuation.section.braces.begin.go +// ^ punctuation.section.braces.end.go +// ^ punctuation.section.brackets.end.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ storage.type.go + + type Ident [Ident interface{}] ident.Ident +// ^^^^ keyword.declaration.type.go +// ^^^^^ entity.name.type.go +// ^ punctuation.section.brackets.begin.go +// ^^^^^ variable.parameter.type.go +// ^^^^^^^^^^^ meta.type.go +// ^^^^^^^^^ keyword.declaration.interface.go +// ^ punctuation.section.braces.begin.go +// ^ punctuation.section.braces.end.go +// ^ punctuation.section.brackets.end.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ storage.type.go + + type Ident [Ident map[ident.Ident]ident.Ident] ident.Ident +// ^^^^ keyword.declaration.type.go +// ^^^^^ entity.name.type.go +// ^ punctuation.section.brackets.begin.go +// ^^^^^ variable.parameter.type.go +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^^^ keyword.declaration.map.go +// ^ punctuation.section.brackets.begin.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ storage.type.go +// ^ punctuation.section.brackets.end.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ storage.type.go +// ^ punctuation.section.brackets.end.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ storage.type.go + + type Ident [ +// ^^^^ keyword.declaration.type.go +// ^^^^^ entity.name.type.go +// ^ punctuation.section.brackets.begin.go + Ident ident.Ident, +// ^^^^^ variable.parameter.type.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ storage.type.go +// ^ punctuation.separator.go + Ident interface{ +// ^^^^^ variable.parameter.type.go +// ^^^^^^^^^^ meta.type.go +// ^^^^^^^^^ keyword.declaration.interface.go +// ^ punctuation.section.braces.begin.go + ident.Ident +//^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ storage.type.go + Method() ident.Ident +//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.type.go +// ^^^^^^ entity.name.function.go +// ^ punctuation.section.parens.begin.go +// ^ punctuation.section.parens.end.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ storage.type.go + }, +//^^^^^^^ meta.type.go +// ^ punctuation.section.braces.end.go +// ^ punctuation.separator.go + ] [Ident * Ident] ident.Ident +// ^ punctuation.section.brackets.end.go +// ^ punctuation.section.brackets.begin.go +// ^^^^^ variable.other.go +// ^ keyword.operator.go +// ^^^^^ variable.other.go +// ^ punctuation.section.brackets.end.go +// ^^^^^ variable.other.go +// ^ punctuation.accessor.dot.go +// ^^^^^ storage.type.go + -// # Constants and Vars +/* # Constants and Vars */ // Note: initialization expressions may span multiple lines, but the syntax // currently doesn't support this due to implementation difficulties. This may @@ -1847,7 +3989,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types". ) // ^ punctuation.section.parens.end.go -// ## Short Variable Declaration +/* ## Short Variable Declaration */ ident := expr // ^^^^^ variable.other.readwrite.declaration.go @@ -1874,11 +4016,11 @@ Note: built-ins are tested separately. Search for "# Built-in Types". // ^ keyword.operator.assignment.go // ^^^^ variable.other.go -// # Literals +/* # Literals */ -// ## Integers +/* ## Integers */ -// ### Decimal +/* ### Decimal */ 0; 123456789; -0; -123456789; 1777_000_000; // ^ meta.number.integer.decimal.go constant.numeric.value.go @@ -1889,7 +4031,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types". // ^^^^^^^^^ meta.number.integer.decimal.go constant.numeric.value.go // ^^^^^^^^^^^^ meta.number.integer.decimal.go constant.numeric.value.go -// ### Octal +/* ### Octal */ 00; 01234567; -01234567; 0_0; 012_45; // ^ meta.number.integer.octal.go constant.numeric.base.go @@ -1921,7 +4063,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types". // ^^ meta.number.integer.octal.go constant.numeric.base.go // ^^^^^ meta.number.integer.octal.go constant.numeric.value.go -// ### Hex +/* ### Hex */ 0x0; 0x0123456789ABCDEFabcdef; -0x0123456789ABCDEFabcdef; // ^^ meta.number.integer.hexadecimal.go constant.numeric.base.go @@ -1938,7 +4080,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types". // ^^ meta.number.integer.hexadecimal.go constant.numeric.base.go // ^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.number.integer.hexadecimal.go constant.numeric.value.go -// ### Binary +/* ### Binary */ 0b1011; 0B00001; -0b1; 0b_1; 0B1_0; // ^^ meta.number.integer.binary.go constant.numeric.base.go @@ -1953,7 +4095,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types". // ^^ meta.number.integer.binary.go constant.numeric.base.go // ^^^ meta.number.integer.binary.go constant.numeric.value.go -// ## Floats +/* ## Floats */ 000.000; 123.456; .0; 1.; // ^^^^^^^ meta.number.float.decimal.go constant.numeric.value.go @@ -2067,7 +4209,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types". // ^^^^^ meta.number.float.hexadecimal.go constant.numeric.value.go // ^ punctuation.separator.decimal.go -// ## Imaginary +/* ## Imaginary */ 000i; 100i; -100i; 1_1i; // ^^^^ meta.number.imaginary.decimal.go @@ -2197,7 +4339,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types". // ^ punctuation.separator.decimal.go // ^ meta.number.imaginary.hexadecimal.go constant.numeric.suffix.go -// ## Runes +/* ## Runes */ ' ' // ^^^ meta.string.go string.quoted.single.go @@ -2243,7 +4385,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types". // ^^^^ constant.character.escape.go // ^ punctuation.definition.string.end.go - constant -// ## Strings +/* ## Strings */ "one two" // ^ punctuation.definition.string.begin.go @@ -2327,57 +4469,57 @@ Note: built-ins are tested separately. Search for "# Built-in Types". `one two` // ^ punctuation.definition.string.begin.go -// ^^^^^^^^^ string.quoted.other.go +// ^^^^^^^^^ string.quoted.backtick.go // ^ punctuation.definition.string.end.go `one \\ \n two` -// ^^^^^^^^^^^^^^^ string.quoted.other.go -constant.character.escape +// ^^^^^^^^^^^^^^^ string.quoted.backtick.go -constant.character.escape `one %% two` -// ^^^^^^^^^^^^ string.quoted.other.go +// ^^^^^^^^^^^^ string.quoted.backtick.go // ^^ constant.character.escape.go `one % two` -// ^^^^^^^^^^^ string.quoted.other.go +// ^^^^^^^^^^^ string.quoted.backtick.go // ^^^ constant.other.placeholder.go `one %v two` -// ^^^^^^^^^^^^ string.quoted.other.go +// ^^^^^^^^^^^^ string.quoted.backtick.go // ^^ constant.other.placeholder.go `one %+v two` -// ^^^^^^^^^^^^^ string.quoted.other.go +// ^^^^^^^^^^^^^ string.quoted.backtick.go // ^^^ constant.other.placeholder.go `one %1.2d two` -// ^^^^^^^^^^^^^^^ string.quoted.other.go +// ^^^^^^^^^^^^^^^ string.quoted.backtick.go // ^^^^^ constant.other.placeholder.go `one %[1] two` -// ^^^^^^^^^^^ string.quoted.other.go +// ^^^^^^^^^^^ string.quoted.backtick.go // ^^^^^^ constant.other.placeholder.go `one %[1]v two` -// ^^^^^^^^^^^^ string.quoted.other.go +// ^^^^^^^^^^^^ string.quoted.backtick.go // ^^^^^ constant.other.placeholder.go `one %[1]+v two` -// ^^^^^^^^^^^^^ string.quoted.other.go +// ^^^^^^^^^^^^^ string.quoted.backtick.go // ^^^^^^ constant.other.placeholder.go `one %[1]1.2d two` -// ^^^^^^^^^^^^^^^ string.quoted.other.go +// ^^^^^^^^^^^^^^^ string.quoted.backtick.go // ^^^^^^^^ constant.other.placeholder.go `%` -// ^^^ string.quoted.other.go +// ^^^ string.quoted.backtick.go // ^ -constant.other.placeholder ` -// ^ string.quoted.other.go punctuation.definition.string.begin.go +// ^ string.quoted.backtick.go punctuation.definition.string.begin.go one -// ^^^ string.quoted.other.go +// ^^^ string.quoted.backtick.go two -// ^^^ string.quoted.other.go +// ^^^ string.quoted.backtick.go three -// ^^^^^ string.quoted.other.go +// ^^^^^ string.quoted.backtick.go ` -// ^ string.quoted.other.go punctuation.definition.string.end.go +// ^ string.quoted.backtick.go punctuation.definition.string.end.go `one /* two */ three` -// ^^^^^^^^^^^^^^^^^^^^^ string.quoted.other.go -comment +// ^^^^^^^^^^^^^^^^^^^^^ string.quoted.backtick.go -comment -// # Operators +/* # Operators */ != // ^^ keyword.operator.comparison.go @@ -2451,9 +4593,11 @@ Note: built-ins are tested separately. Search for "# Built-in Types". // ^^ keyword.operator.logical.go | // ^ keyword.operator.bitwise.go + ~ +// ^ keyword.operator.go -// # Punctuation +/* # Punctuation */ // Note: [] can denote array and slice types. It's covered in the type section. @@ -2477,9 +4621,9 @@ Note: built-ins are tested separately. Search for "# Built-in Types". } // ^ meta.block.go punctuation.section.braces.end.go -// ## Selector +/* ## Selector */ -// ### Member +/* ### Member */ ident.ident // ^^^^^ variable.other.go @@ -2506,7 +4650,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types". ident // ^^^^^ variable.other.member.go -// ### Type Assertion +/* ### Type Assertion */ ident.(ident) // ^^^^^ variable.other.go @@ -2517,11 +4661,10 @@ Note: built-ins are tested separately. Search for "# Built-in Types". // ^^^^^ variable.other.go /**/./**/ // ^ punctuation.accessor.dot.go - (/* ident */ ident /* ident */ ident) + (/* ident */ ident /* ident */) // ^^^^^^^^^^^ comment.block.go // ^^^^^ storage.type.go // ^^^^^^^^^^^ comment.block.go -// ^^^^^ variable.other.go ident.(chan typ) // ^^^^^ variable.other.go @@ -2585,7 +4728,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types". // ^ punctuation.accessor.dot.go // ^^^^^ storage.type.go -// ## Parens +/* ## Parens */ // Note: we can't syntactically disambiguate calls and type conversions. @@ -2665,7 +4808,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types". // ^ punctuation.accessor.dot.go // ^^^^ comment.block.go ident /**/ )) /**/ (( -// ^^^^^ variable.function.go +// ^^^^^ variable.other.member.go // ^^^^ comment.block.go // ^^ punctuation.section.parens.end.go // ^^^^ comment.block.go @@ -2701,8 +4844,33 @@ Note: built-ins are tested separately. Search for "# Built-in Types". // ^^^ storage.type.go // ^^^^^ variable.other.go + ident[]() +// ^^^^^ variable.function.go +// ^ punctuation.section.brackets.begin.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.section.parens.begin.go +// ^ punctuation.section.parens.end.go + + ident[typ]() +// ^^^^^ variable.function.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.section.parens.begin.go +// ^ punctuation.section.parens.end.go + + ident[typ, typ]() +// ^^^^^ variable.function.go +// ^ punctuation.section.brackets.begin.go +// ^^^ variable.other.type.go +// ^ punctuation.separator.go +// ^^^ variable.other.type.go +// ^ punctuation.section.brackets.end.go +// ^ punctuation.section.parens.begin.go +// ^ punctuation.section.parens.end.go + -// # Keywords +/* # Keywords */ // Some keywords are covered elsewhere in the test. @@ -2737,7 +4905,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types". switch // ^^^^^^ keyword.control.go -// ## func +/* ## func */ // Note: function signatures are thoroughly tested in the section of this test // file dedicated to types. The part after the function name (parameters and @@ -2778,7 +4946,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types". ) typ {} // ^^^ storage.type.go -// Methods +/* ### Methods */ func (self Type) Method() {} // ^ meta.function.declaration.go punctuation.section.parens.begin.go @@ -2801,7 +4969,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types". func /**/ // ^^^^ keyword.declaration.function.go // ^^^^ comment.block.go - ( /**/ self /**/ * /**/ ident /**/ . /**/ Type /**/ ) /**/ Method /**/ ( + ( /**/ self /**/ * /**/ ident . /**/ Type /**/ ) /**/ Method /**/ ( // ^ meta.function.declaration.go punctuation.section.parens.begin.go // ^^^^ meta.function.declaration.go comment.block.go // ^^^^ meta.function.declaration.go variable.parameter.go @@ -2809,15 +4977,14 @@ Note: built-ins are tested separately. Search for "# Built-in Types". // ^ meta.function.declaration.go keyword.operator.go // ^^^^ meta.function.declaration.go comment.block.go // ^^^^^ meta.function.declaration.go variable.other.go -// ^^^^ meta.function.declaration.go comment.block.go -// ^ meta.function.declaration.go punctuation.accessor.dot.go -// ^^^^ meta.function.declaration.go comment.block.go -// ^^^^ meta.function.declaration.go storage.type.go -// ^^^^ meta.function.declaration.go comment.block.go -// ^ meta.function.declaration.go punctuation.section.parens.end.go -// ^^^^ meta.function.declaration.go comment.block.go -// ^^^^^^ meta.function.declaration.go entity.name.function.go -// ^^^^ comment.block.go +// ^ meta.function.declaration.go punctuation.accessor.dot.go +// ^^^^ meta.function.declaration.go comment.block.go +// ^^^^ meta.function.declaration.go storage.type.go +// ^^^^ meta.function.declaration.go comment.block.go +// ^ meta.function.declaration.go punctuation.section.parens.end.go +// ^^^^ meta.function.declaration.go comment.block.go +// ^^^^^^ meta.function.declaration.go entity.name.function.go +// ^^^^ comment.block.go param typ // ^^^^^ variable.parameter.go // ^^^ storage.type.go @@ -2827,7 +4994,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types". // ^ meta.block.go punctuation.section.braces.end.go -// # Predeclared Constants +/* # Predeclared Constants */ true false nil // ^^^^ constant.language.go @@ -2835,7 +5002,7 @@ Note: built-ins are tested separately. Search for "# Built-in Types". // ^^^ constant.language.go -// # Built-in Types +/* # Built-in Types */ /* These tests make sure that the treatment of built-ins is consistent with @@ -2885,11 +5052,11 @@ every type individually. interface { typ } // ^^^^^^^^^ keyword.declaration.interface.go -// ^^^ meta.type.go entity.other.inherited-class.go -support +// ^^^ meta.type.go storage.type.go -support interface { error } // ^^^^^^^^^ keyword.declaration.interface.go -// ^^^^^ meta.type.go entity.other.inherited-class.go support.type.builtin.go +// ^^^^^ meta.type.go storage.type.go support.type.builtin.go [...]typ // ^^^ keyword.operator.variadic.go @@ -2952,30 +5119,39 @@ every type individually. // ^^^^^ variable.other.go -// # Built-in Functions +/* # Built-in Functions */ -// ## Special Functions +/* ## Special Functions */ make(typ) // ^^^^ variable.function.go support.function.builtin.go +// ^ punctuation.section.parens.begin.go // ^^^ storage.type.go -support +// ^ punctuation.section.parens.end.go make(int) // ^^^^ variable.function.go support.function.builtin.go +// ^ punctuation.section.parens.begin.go // ^^^ storage.type.go support.type.builtin.go +// ^ punctuation.section.parens.end.go make /**/ ( // ^^^^ variable.function.go support.function.builtin.go // ^^^^ comment.block.go +// ^ punctuation.section.parens.begin.go /**/ typ /**/, // ^^^^ comment.block.go // ^^^ storage.type.go -support // ^^^^ comment.block.go +// ^ punctuation.separator.go ident, // ^^^^^ variable.other.go +// ^ punctuation.separator.go ident, // ^^^^^ variable.other.go +// ^ punctuation.separator.go ) +// ^ punctuation.section.parens.end.go make /**/ ( // ^^^^ variable.function.go support.function.builtin.go @@ -2999,24 +5175,17 @@ every type individually. new(typ, ident) // ^^^ variable.function.go support.function.builtin.go -// ^^^ storage.type.go -support +// ^ punctuation.section.parens.begin.go +// ^^^ storage.type.go +// ^ punctuation.separator.go // ^^^^^ variable.other.go +// ^ punctuation.section.parens.end.go new(int, ident) // ^^^ variable.function.go support.function.builtin.go // ^^^ storage.type.go support.type.builtin.go // ^^^^^ variable.other.go - ((new))(typ, ident) -// ^^^ variable.function.go support.function.builtin.go -// ^^^ storage.type.go -support -// ^^^^^ variable.other.go - - ((new))(int, ident) -// ^^^ variable.function.go support.function.builtin.go -// ^^^ storage.type.go support.type.builtin.go -// ^^^^^ variable.other.go - new /**/ ( // ^^^ variable.function.go support.function.builtin.go // ^^^^ comment.block.go @@ -3042,7 +5211,7 @@ every type individually. // ^^^ keyword.declaration.var.go // ^^^ variable.other.readwrite.declaration.go -support -// ## Other Functions +/* ## Other Functions */ /* These tests make sure that the treatment of built-ins is consistent with