@bablr/language-en-blank-space 0.8.0 → 0.10.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/grammar.js +40 -18
- package/package.json +9 -14
- package/lib/grammar.macro.js +0 -12
package/lib/grammar.js
CHANGED
|
@@ -1,23 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* This file is autogenerated. Please do not edit it directly.
|
|
5
|
-
* When editing run `npx macrome watch` then change the file this is generated from.
|
|
6
|
-
*/
|
|
7
|
-
import _applyDecs from "@babel/runtime/helpers/applyDecs2305";
|
|
8
|
-
let _initProto;
|
|
9
|
-
import { re } from '@bablr/boot';
|
|
10
|
-
import { eat } from '@bablr/helpers/grammar';
|
|
11
|
-
import { Node } from '@bablr/helpers/decorators';
|
|
1
|
+
import { re, spam as m } from '@bablr/boot';
|
|
2
|
+
import { o, eat, match, eatMatch } from '@bablr/helpers/grammar';
|
|
3
|
+
|
|
12
4
|
export const canonicalURL = 'https://bablr.org/languages/core/en/space-tab-newline';
|
|
5
|
+
|
|
6
|
+
export const defaultMatcher = m`<__Blanks />`;
|
|
7
|
+
|
|
13
8
|
export const grammar = class BlankSpaceGrammar {
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
*Blanks() {
|
|
10
|
+
while (yield eatMatch(m`<Blank />`));
|
|
16
11
|
}
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
|
|
13
|
+
*Blank() {
|
|
14
|
+
if (yield match(re`/^/m`)) {
|
|
15
|
+
yield eatMatch(m`<LeftOffset />`);
|
|
16
|
+
yield eatMatch(m`<*Space /[ \t\r\n]+/ />`, o({}), o({ literal: true }));
|
|
17
|
+
} else if (yield match(re`/[\r\n]/`)) {
|
|
18
|
+
yield eat(m`<*Newline /\r?\n?/ />`, o({}), o({ literal: true }));
|
|
19
|
+
} else {
|
|
20
|
+
yield eat(m`<*Space /[ \t]+/ />`, o({}), o({ literal: true }));
|
|
21
|
+
}
|
|
19
22
|
}
|
|
20
|
-
|
|
21
|
-
|
|
23
|
+
|
|
24
|
+
*Space({ props: { onlySameLine } }) {
|
|
25
|
+
if (onlySameLine) {
|
|
26
|
+
yield eat(re`/[ \t]+/`);
|
|
27
|
+
} else {
|
|
28
|
+
yield eat(re`/[ \t\r\n]+/`);
|
|
29
|
+
}
|
|
22
30
|
}
|
|
23
|
-
|
|
31
|
+
|
|
32
|
+
*LeftOffset() {
|
|
33
|
+
while (yield eatMatch(m`indents[]: <*Indent /\t| / />`, o({}), o({ literal: true }))) {}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
*Newline() {
|
|
37
|
+
yield eat(re`/\r?\n?/`);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
*Indent() {
|
|
41
|
+
yield eat(re`/\t| /`);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export default { canonicalURL, dependencies: {}, grammar, defaultMatcher };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bablr/language-en-blank-space",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "A BABLR language for tabs, spaces, and line terminators",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=12.0.0"
|
|
@@ -14,21 +14,13 @@
|
|
|
14
14
|
"lib/**/*.js"
|
|
15
15
|
],
|
|
16
16
|
"sideEffects": false,
|
|
17
|
-
"scripts": {
|
|
18
|
-
"build": "macrome build",
|
|
19
|
-
"watch": "macrome watch",
|
|
20
|
-
"clean": "macrome clean"
|
|
21
|
-
},
|
|
22
17
|
"dependencies": {
|
|
23
|
-
"@
|
|
24
|
-
"@bablr/helpers": "0.
|
|
25
|
-
"@bablr/agast-helpers": "0.
|
|
26
|
-
"@bablr/
|
|
27
|
-
"@bablr/boot": "0.9.0"
|
|
18
|
+
"@bablr/helpers": "0.25.0",
|
|
19
|
+
"@bablr/agast-helpers": "0.10.0",
|
|
20
|
+
"@bablr/agast-vm-helpers": "0.10.0",
|
|
21
|
+
"@bablr/boot": "0.11.0"
|
|
28
22
|
},
|
|
29
23
|
"devDependencies": {
|
|
30
|
-
"@bablr/macrome": "^0.1.3",
|
|
31
|
-
"@bablr/macrome-generator-bablr": "^0.3.2",
|
|
32
24
|
"@bablr/eslint-config-base": "github:bablr-lang/eslint-config-base#c97bfa4b3663f8378e9b3e42bb5a41e685406cf9",
|
|
33
25
|
"enhanced-resolve": "^5.12.0",
|
|
34
26
|
"eslint": "^8.47.0",
|
|
@@ -43,7 +35,10 @@
|
|
|
43
35
|
"blankspace",
|
|
44
36
|
"whitespace"
|
|
45
37
|
],
|
|
46
|
-
"repository":
|
|
38
|
+
"repository": {
|
|
39
|
+
"type": "git",
|
|
40
|
+
"url": "git+ssh://git@github.com/bablr-lang/language-en-blank-space.git"
|
|
41
|
+
},
|
|
47
42
|
"homepage": "https://github.com/bablr-lang/language-en-blank-space",
|
|
48
43
|
"author": "Conrad Buck <conartist6@gmail.com>",
|
|
49
44
|
"license": "MIT"
|
package/lib/grammar.macro.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { re } from '@bablr/boot';
|
|
2
|
-
import { eat } from '@bablr/helpers/grammar';
|
|
3
|
-
import { Node } from '@bablr/helpers/decorators';
|
|
4
|
-
|
|
5
|
-
export const canonicalURL = 'https://bablr.org/languages/core/en/space-tab-newline';
|
|
6
|
-
|
|
7
|
-
export const grammar = class BlankSpaceGrammar {
|
|
8
|
-
@Node
|
|
9
|
-
*Space() {
|
|
10
|
-
yield eat(re`/[ \t\r\n]+/`);
|
|
11
|
-
}
|
|
12
|
-
};
|