@lucy/prism 1.6.0 → 1.7.1
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/lib/lucy.js +22 -2
- package/package.json +1 -1
package/lib/lucy.js
CHANGED
|
@@ -2,9 +2,9 @@ function addLucy(Prism) {
|
|
|
2
2
|
Prism.languages.lucy = Prism.languages.extend('clike', {
|
|
3
3
|
'class-name': [
|
|
4
4
|
Prism.languages.clike['class-name'],
|
|
5
|
-
// The type in `event name(Type)`.
|
|
5
|
+
// The type in `event name(Type)` and `input name(Type)`.
|
|
6
6
|
{
|
|
7
|
-
pattern: /(\
|
|
7
|
+
pattern: /(\b(?:event|input)\s+[a-zA-Z_]\w*\s*\(\s*)[a-zA-Z_]\w*(?=\s*\))/,
|
|
8
8
|
lookbehind: true
|
|
9
9
|
}
|
|
10
10
|
],
|
|
@@ -22,6 +22,26 @@ function addLucy(Prism) {
|
|
|
22
22
|
{
|
|
23
23
|
pattern: /\bevent(?=\s+[a-zA-Z_])/
|
|
24
24
|
},
|
|
25
|
+
// `input name`, likewise.
|
|
26
|
+
{
|
|
27
|
+
pattern: /\binput(?=\s+[a-zA-Z_])/
|
|
28
|
+
},
|
|
29
|
+
// Values, in a spawn's block and as the data of a send: event.data,
|
|
30
|
+
// and self and parent after the = or the comma (and parent in
|
|
31
|
+
// send(parent, ...)). An event or a state called self or parent is
|
|
32
|
+
// neither.
|
|
33
|
+
{
|
|
34
|
+
pattern: /\bevent(?=\.data\b)/
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
pattern: /([=(]\s*)(?:self|parent)\b/,
|
|
38
|
+
lookbehind: true
|
|
39
|
+
},
|
|
40
|
+
// The last argument of a send, not a name in a use list.
|
|
41
|
+
{
|
|
42
|
+
pattern: /(,\s*)(?:self|parent)(?=\s*\))/,
|
|
43
|
+
lookbehind: true
|
|
44
|
+
},
|
|
25
45
|
{
|
|
26
46
|
pattern: /\b(?:action|guard)\s+(?!\()\b/,
|
|
27
47
|
lookbehind: true
|