feat(parser): split plain statements on semicolons in the raw parse
Test / test (push) Failing after 2m30s
Test / test (push) Failing after 2m30s
Assisted-by: GLM 5.3 Flash
This commit is contained in:
@@ -182,6 +182,19 @@ func TestNulIsIllegal(t *testing.T) {
|
||||
eq(t, texts("MOVQ \x00 AX"), []string{"MOVQ", "\x00", "AX"})
|
||||
}
|
||||
|
||||
func TestDivisionSlashInIdentifiers(t *testing.T) {
|
||||
// U+2215 DIVISION SLASH is an identifier character, the way the
|
||||
// toolchain's tokenizer treats it: the package path of a symbol is
|
||||
// written with it (internal∕runtime∕atomic·Xchg) and must lex as one
|
||||
// name. The ordinary slash (U+002F) stays punctuation.
|
||||
eq(t, texts("CALL internal∕runtime∕atomic·Xchg(SB)"),
|
||||
[]string{"CALL", "internal∕runtime∕atomic·Xchg", "(", "SB", ")"})
|
||||
eq(t, texts("MOVQ sync∕atomic·Align(SB), AX"),
|
||||
[]string{"MOVQ", "sync∕atomic·Align", "(", "SB", ")", ",", "AX"})
|
||||
// It may also begin a name, like any letter of the toolchain's rule.
|
||||
eq(t, kinds("∕x"), []token.Kind{token.Ident})
|
||||
}
|
||||
|
||||
// TestOffsetsAroundInvalidByte pins Position.Offset against the original
|
||||
// bytes: an invalid UTF-8 byte decodes to RuneError but advances the offset
|
||||
// table by exactly one byte, so every later position stays a true byte
|
||||
|
||||
Reference in New Issue
Block a user