File tree 2 files changed +14
-1
lines changed 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -107,9 +107,16 @@ func Make(token ScanToken, text string) Token {
107
107
if token == scanner .Ident && strings .HasPrefix (text , "\u00B7 " ) {
108
108
text = `""` + text
109
109
}
110
- // Substitute the substitutes for . and /.
110
+ // If the symbol starts with type··x, rewrite it as type·""·x
111
+ if token == scanner .Ident && strings .HasPrefix (text , "type\u00B7 \u00B7 " ) {
112
+ text = "type\u00B7 " + `""` + text [len ("type\u00B7 " ):]
113
+ }
114
+ // Substitute the substitutes for '.', '/', '*', '(' and ')'.
111
115
text = strings .Replace (text , "\u00B7 " , "." , - 1 )
112
116
text = strings .Replace (text , "\u2215 " , "/" , - 1 )
117
+ text = strings .Replace (text , "\u2217 " , "*" , - 1 )
118
+ text = strings .Replace (text , "\uFF08 " , "(" , - 1 )
119
+ text = strings .Replace (text , "\uFF09 " , ")" , - 1 )
113
120
return Token {ScanToken : token , text : text }
114
121
}
115
122
Original file line number Diff line number Diff line change @@ -61,6 +61,12 @@ func isIdentRune(ch rune, i int) bool {
61
61
return true
62
62
case '\u2215' : // Represents the slash in runtime/debug.setGCPercent. U+2215 '∕' division slash
63
63
return true
64
+ case '\u2217' : // Represents the asterisk in main.(*SomeType).method. U+2217 '∗' asterisk
65
+ return true
66
+ case '\uFF08' : // Represents the left parentheses in main.(*SomeType).method. U+FF08 '(' left parentheses
67
+ return true
68
+ case '\uFF09' : // Represents the right parentheses in main.(*SomeType).method. U+FF09 ')' right parentheses
69
+ return true
64
70
}
65
71
// Digits are OK only after the first character.
66
72
return i > 0 && unicode .IsDigit (ch )
You can’t perform that action at this time.
0 commit comments