@lucy/prism 1.6.0 → 1.7.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/lib/lucy.js +16 -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,20 @@ 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
|
+
// The values a spawn gives: event.data, and self and parent after
|
|
30
|
+
// the = (and parent in send(parent, ...)). An event or a state called
|
|
31
|
+
// self or parent is neither.
|
|
32
|
+
{
|
|
33
|
+
pattern: /\bevent(?=\.data\b)/
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
pattern: /([=(]\s*)(?:self|parent)\b/,
|
|
37
|
+
lookbehind: true
|
|
38
|
+
},
|
|
25
39
|
{
|
|
26
40
|
pattern: /\b(?:action|guard)\s+(?!\()\b/,
|
|
27
41
|
lookbehind: true
|