feat(asm): symbol-valued DATA, division slash in symbols and plain semicolons
Assisted-by: GLM 5.3 Flash
This commit is contained in:
+11
-3
@@ -16,8 +16,16 @@ import (
|
||||
"sourcedock.dev/petrbalvin/gasm-devkit/token"
|
||||
)
|
||||
|
||||
// middleDot is the Plan 9 symbol separator (U+00B7), used in ·funcName(SB).
|
||||
const middleDot = '\u00B7'
|
||||
const (
|
||||
// middleDot is the Plan 9 symbol separator (U+00B7), used in
|
||||
// ·funcName(SB): it stands for the period between package path and name.
|
||||
middleDot = '\u00B7'
|
||||
// divisionSlash is the Plan 9 path separator (U+2215), used inside the
|
||||
// package path of a symbol: internal∕runtime∕atomic·Xchg. Like the
|
||||
// middle dot it is an identifier character, so a package path containing
|
||||
// it lexes as one name; the ordinary slash (U+002F) stays punctuation.
|
||||
divisionSlash = '\u2215'
|
||||
)
|
||||
|
||||
// Lexer scans a source string one token at a time.
|
||||
type Lexer struct {
|
||||
@@ -460,7 +468,7 @@ func isHexDigit(r rune) bool {
|
||||
}
|
||||
|
||||
func isIdentStart(r rune) bool {
|
||||
return r == '_' || r == middleDot || unicode.IsLetter(r)
|
||||
return r == '_' || r == middleDot || r == divisionSlash || unicode.IsLetter(r)
|
||||
}
|
||||
|
||||
func isIdentChar(r rune) bool {
|
||||
|
||||
Reference in New Issue
Block a user