https://bugs.kde.org/show_bug.cgi?id=459291
Bug ID: 459291
Summary: Go (Golang) missing Unicode escapes, 1.13 number
literals and 1.18 generic keywords
Classification: Unclassified
Product: frameworks-syntax-highlighting
Version: unspecified
Platform: Other
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: syntax
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Target Milestone: ---
STEPS TO REPRODUCE
With syntax highlighting mode set to Go, paste this text into Kate.
var s string = "A string with \x60 a horse \140 \u2014 \U0001F40E"
var c float32 = imag(987i) + 0o_7_7_7 + 0x1.fp-2
type R[T any, C comparable] struct { a T; b C }
OBSERVED RESULT
In line 1, the escape sequences \u2014 and \U0001F40E (called "little Unicode
escapes" and "big Unicode escapes" respectively) are not highlighted in a
different color from the string like \x60 and \140.
The "i" of "987i" is not highlighted at all and only the 0s of "0o_7_7_7" and
"0x1.fp-2" are highlighted.
The keywords "any" and "comparable" are not highlighted.
EXPECTED RESULT
\u2014 and \U0001F40E should be distinguished in a different color from the
string.
987i, 0o_7_7_7 and 0x1.fp-2 should all be highlighted start to finish as valid
number literals.
"any" and "comparable" should be highlighted as predeclared types.
SOFTWARE/OS VERSIONS
Operating System: Kubuntu 20.04
KDE Plasma Version: 5.18.8
KDE Frameworks Version: 5.68.0
Qt Version: 5.12.8
Kernel Version: 5.11.0-36-generic
OS Type: 64-bit
ADDITIONAL INFORMATION
Go has from the beginning supported escaping a Unicode character in a string
with a backslash, the character "u" (lowercase u), and four hexadecimal digits.
This syntax is not recognized by Kate.
Go has from the beginning supported escaping a Unicode character in a string
with a backslash, the character "U" (uppercase U), and eight hexadecimal
digits. This syntax is not recognized by Kate.
Go 1.13, https://go.dev/doc/go1.13, introduced many new number literal
syntaxes:
* Binary integer literals with the prefix 0b/0B
* Octal integer literals with the prefix 0o/0O
* Hexadecimal floating point literals, 0x + a decimal number + "p" + optionally
"+" or "-" +
* Digit separators, an underscore may be inserted between any two digits, or
after the letter in 0b/0o/0x
* The ability to suffix the imaginary literal "i" to any literal
None of these new syntaxes are supported by Kate. Note also that basic
hexadecimal literals, such as 0x1, do not work properly with KDE syntax
highlighting in Go.
Go 1.18 introduced generic programming and added two new predefined types,
"comparable" and "any". They should be highlighted the same color as other
predeclared types like "string" and "int".
--
You are receiving this mail because:
You are watching all bug changes.