codemirror-lang-raku 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +46 -0
- package/README.md +16 -5
- package/dist/index.cjs +268 -49
- package/dist/index.js +268 -49
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,49 @@
|
|
|
1
|
+
## 0.4.0 (2026-10-07)
|
|
2
|
+
|
|
3
|
+
Most of this was found by parsing the test suite of
|
|
4
|
+
[mutsu](https://github.com/tokuhirom/mutsu), an implementation of Raku.
|
|
5
|
+
|
|
6
|
+
### Breaking changes
|
|
7
|
+
|
|
8
|
+
- The name of a constant with a sigil, as in `constant $LIMIT = 3`, is a
|
|
9
|
+
`ConstantName` inside the `ConstantDeclaration`. It was a
|
|
10
|
+
`VariableName` after the declaration, which had no name.
|
|
11
|
+
- A `:sym<…>` that follows the name of a declaration after blanks, as in
|
|
12
|
+
`token word :sym<long> { }`, is part of the `RegexName`.
|
|
13
|
+
- A declarator comment with brackets, `#|( … )` or `#=( … )`, is one
|
|
14
|
+
`DocComment` up to its closing bracket. It ended with its first line,
|
|
15
|
+
and still does when the bracket is not closed.
|
|
16
|
+
|
|
17
|
+
### New features
|
|
18
|
+
|
|
19
|
+
- Corner quotes (`「…」`), also after a quote word (`Q「…」`), the low
|
|
20
|
+
curly quotes (`„…”`, `„…“`, `‚…’`, `‚…‘`) and the reversed `”…”`.
|
|
21
|
+
- A quote word takes a backtick or a symbol outside of ASCII for a
|
|
22
|
+
delimiter: ``qx`…` ``, `Q♥…♥`.
|
|
23
|
+
- Fractions that are one character (`½`, `⅔`) are numbers, and a power
|
|
24
|
+
in superscript (`$x²`) is an operator.
|
|
25
|
+
- Symbols outside of ASCII are operators: the atomic operators
|
|
26
|
+
(`⚛+=`), and the operators of one's own (`1 ⚡ 2`).
|
|
27
|
+
- The set operators that are written in parentheses, as in
|
|
28
|
+
`$a (<=) $b` and `$x (elem) $s`, are operators.
|
|
29
|
+
- An operator in brackets as a routine, as in `&[+]`, is a
|
|
30
|
+
`VariableName`.
|
|
31
|
+
- The name of an operator can be written in double angles:
|
|
32
|
+
`infix:<< plus-one >>`, `&infix:<<(>=)>>`.
|
|
33
|
+
- The variable `$¢`.
|
|
34
|
+
|
|
35
|
+
### Bug fixes
|
|
36
|
+
|
|
37
|
+
- In a regex, `‘…’`, `“…”`, `‚…’`, `„…”` and `「…」` are quotes, in which
|
|
38
|
+
the delimiter of the regex does not end it: `m/ab ‘/’ c/`.
|
|
39
|
+
- A list of words in a regex, `/ < a ' b > /`, no longer starts a quote
|
|
40
|
+
at a `'` in it.
|
|
41
|
+
- A regex does not end at its delimiter in code: in the arguments of an
|
|
42
|
+
assertion (`<name: /a/ >`, `<:name(/a/)>`), in `$( … )`, and in a
|
|
43
|
+
declaration (`:my $m = $/;`).
|
|
44
|
+
- A `$/` in the replacement of a substitution does not end it:
|
|
45
|
+
`s/(a)/[$/]/`.
|
|
46
|
+
|
|
1
47
|
## 0.3.0 (2026-10-07)
|
|
2
48
|
|
|
3
49
|
### Breaking changes
|
package/README.md
CHANGED
|
@@ -87,8 +87,8 @@ on incomplete code.
|
|
|
87
87
|
|---|---|
|
|
88
88
|
| `PackageDeclaration` | `class`, `role`, `grammar`, `module`, `package`, with a `PackageName` child, up to the body `Block` or the `;` of a `unit` declaration |
|
|
89
89
|
| `RoutineDeclaration` | `sub`, `method`, `submethod`, with a `RoutineName` child (absent for anonymous routines), up to the body `Block`. Also the `foo(…) { }` of `multi foo(…) { }`, which declares a sub without the word `sub`: that node starts with its `RoutineName` |
|
|
90
|
-
| `RegexDeclaration` | `token`, `rule`, `regex`, with a `RegexName` child, up to the body `Block`, which holds one `Regex` |
|
|
91
|
-
| `EnumDeclaration`, `SubsetDeclaration`, `ConstantDeclaration` | The declarator and its `EnumName`, `SubsetName` or `ConstantName` |
|
|
90
|
+
| `RegexDeclaration` | `token`, `rule`, `regex`, with a `RegexName` child, up to the body `Block`, which holds one `Regex`. The name includes a `:sym<…>`, with the blanks before it if there are any (`word :sym<long>`) |
|
|
91
|
+
| `EnumDeclaration`, `SubsetDeclaration`, `ConstantDeclaration` | The declarator and its `EnumName`, `SubsetName` or `ConstantName`. The name of a constant includes its sigil if it has one (`constant $LIMIT`). A constant without a sigil that is declared with a backslash (`constant \x`) has no `ConstantName` |
|
|
92
92
|
| `Block`, `Parens`, `Brackets` | `{ }`, `( )`, `[ ]` |
|
|
93
93
|
| `VariableName`, `AttributeName`, `SpecialVariable` | `$x` / `$^a`, `$!x` / `$.x`, `$*x` / `$?x` |
|
|
94
94
|
| `StringLiteral` | A quote of any kind. One that interpolates has `Escape`, `Interpolation`, variable, `Brackets`, `Parens` and `MethodCall` children, and a `NestedDelimiters` for each pair of its own delimiters in it (the `[b]` of `qq[a [b] c]`) |
|
|
@@ -113,7 +113,9 @@ Not supported yet:
|
|
|
113
113
|
token, with the code or the nested `<…>` in it, and has to be closed on
|
|
114
114
|
its line unless it is a character class. Groups (`[ ]`, `( )`) and
|
|
115
115
|
adverbs (`:i`, `:my`) are plain text, so the text after `:my` is read
|
|
116
|
-
as regex
|
|
116
|
+
as regex, and so is the code in `$( … )`. Such code does not end the
|
|
117
|
+
regex when it holds the delimiter (`/ :my $m = $/; /`), if it is on
|
|
118
|
+
one line.
|
|
117
119
|
- A heredoc is interpolated when everything interpolates in it, as in
|
|
118
120
|
`qq:to`. One that interpolates in part (`q:c:to`, `qq:!s:to`) is not
|
|
119
121
|
highlighted inside. When a line opens several heredocs, they are
|
|
@@ -132,6 +134,10 @@ Not supported yet:
|
|
|
132
134
|
- A Pod block is read where a statement or a term can stand, not
|
|
133
135
|
everywhere that whitespace can: one between `class` and the name of
|
|
134
136
|
the class is not read as Pod.
|
|
137
|
+
- In a quote that has braces for delimiters, a `{ }` is taken to be a
|
|
138
|
+
nested pair of the delimiters, not a block of code: the `{$b + 1}` of
|
|
139
|
+
`qq{a {$b + 1} c}` is text, in which `$b` is interpolated. With other
|
|
140
|
+
delimiters, as in `qq[a {$b + 1} c]`, it is a block.
|
|
135
141
|
- A quote adverb is switched off by the argument `False` or `0`, as in
|
|
136
142
|
`qq:c(False)[…]`. With any other argument, such as a variable, it
|
|
137
143
|
counts as switched on.
|
|
@@ -139,8 +145,13 @@ Not supported yet:
|
|
|
139
145
|
command. Text that unbalances every bracket that is tried gets
|
|
140
146
|
`` #`( `` … `)`, which then does not cover exactly that text.
|
|
141
147
|
- A user-defined operator is recognized where it is declared
|
|
142
|
-
(`sub infix:<+++>`) and as a routine (`&infix:<+++>`)
|
|
143
|
-
used
|
|
148
|
+
(`sub infix:<+++>`) and as a routine (`&infix:<+++>`). Where it is
|
|
149
|
+
used, it is an operator when it is made of operator characters or of
|
|
150
|
+
symbols outside of ASCII (`1 ⚡ 2`). One that is a word is a plain
|
|
151
|
+
name, also between hyper marks (`@a »plus« @b`), and a term or a
|
|
152
|
+
circumfix of one's own is not known.
|
|
153
|
+
- The `native` declarator, which NativeCall uses internally, does not
|
|
154
|
+
make a declaration node.
|
|
144
155
|
- Completion does not know types. After a `.` it offers the built-in
|
|
145
156
|
methods and every method that the document declares, whatever the
|
|
146
157
|
invocant is. Names from other files are not offered.
|