@lucy/prism 1.5.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 +24 -1
- package/package.json +11 -3
package/lib/lucy.js
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
function addLucy(Prism) {
|
|
2
2
|
Prism.languages.lucy = Prism.languages.extend('clike', {
|
|
3
3
|
'class-name': [
|
|
4
|
-
Prism.languages.clike['class-name']
|
|
4
|
+
Prism.languages.clike['class-name'],
|
|
5
|
+
// The type in `event name(Type)` and `input name(Type)`.
|
|
6
|
+
{
|
|
7
|
+
pattern: /(\b(?:event|input)\s+[a-zA-Z_]\w*\s*\(\s*)[a-zA-Z_]\w*(?=\s*\))/,
|
|
8
|
+
lookbehind: true
|
|
9
|
+
}
|
|
5
10
|
],
|
|
6
11
|
|
|
7
12
|
'keyword': [
|
|
@@ -13,6 +18,24 @@ function addLucy(Prism) {
|
|
|
13
18
|
pattern: /\b(?:use)\b/,
|
|
14
19
|
lookbehind: true
|
|
15
20
|
},
|
|
21
|
+
// `event name`, but not an event called event (`event => idle`).
|
|
22
|
+
{
|
|
23
|
+
pattern: /\bevent(?=\s+[a-zA-Z_])/
|
|
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
|
+
},
|
|
16
39
|
{
|
|
17
40
|
pattern: /\b(?:action|guard)\s+(?!\()\b/,
|
|
18
41
|
lookbehind: true
|
package/package.json
CHANGED
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lucy/prism",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "Prism plugin for the Lucy language",
|
|
5
5
|
"main": "lib/main.js",
|
|
6
6
|
"files": [
|
|
7
7
|
"lib"
|
|
8
8
|
],
|
|
9
9
|
"scripts": {
|
|
10
|
-
"test": "
|
|
10
|
+
"test": "node test/smoke.js"
|
|
11
|
+
},
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git+https://github.com/lucydsl/lucy-prism.git"
|
|
11
15
|
},
|
|
12
16
|
"keywords": [
|
|
13
17
|
"Lucy",
|
|
14
18
|
"Prism"
|
|
15
19
|
],
|
|
16
20
|
"author": "Matthew Phillips",
|
|
17
|
-
"license": "BSD-2-Clause"
|
|
21
|
+
"license": "BSD-2-Clause",
|
|
22
|
+
"bugs": {
|
|
23
|
+
"url": "https://github.com/lucydsl/lucy-prism/issues"
|
|
24
|
+
},
|
|
25
|
+
"homepage": "https://github.com/lucydsl/lucy-prism#readme"
|
|
18
26
|
}
|