Repository navigation
Commit e2f9029
authored
fix: don't treat a non-prefix token before
`namespace()` used the previous token's content as the namespace prefix
whenever a `|` was seen. For an empty namespace written as a bare `|`
(e.g. `|b`), the previous token is whatever precedes it — a comment,
comma, combinator or whitespace — and that was emitted as the prefix.
So `/* c */|b` round-tripped to `/* c */\/\*\ c\ \*\/|b`, `.a,|b` to
`.a,\,|b`, `.a > |b` to `.a > |b`, and so on.
Only use the previous token as a prefix when it can be one: a type/word,
the universal `*`, or the nesting `&` (the tokens whose parsing hands off
to `namespace()`). Otherwise the namespace is empty.| as a namespace (#324)1 parent dd50ee1 commit e2f9029
2 files changed
Lines changed: 26 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
80 | 95 | | |
81 | 96 | | |
82 | 97 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
696 | 696 | | |
697 | 697 | | |
698 | 698 | | |
699 | | - | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
700 | 710 | | |
701 | 711 | | |
702 | 712 | | |
| |||
0 commit comments