@bablr/language-en-blank-space 0.9.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 CHANGED
@@ -1,55 +1,45 @@
1
- /* @macrome
2
- * @generatedby @bablr/macrome-generator-bablr
3
- * @generatedfrom ./grammar.macro.js#a352424fbde9ad17b2ebc13478766a91070c44b6
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
1
  import { re, spam as m } from '@bablr/boot';
10
2
  import { o, eat, match, eatMatch } from '@bablr/helpers/grammar';
11
- import { Node } from '@bablr/helpers/decorators';
3
+
12
4
  export const canonicalURL = 'https://bablr.org/languages/core/en/space-tab-newline';
13
- export const defaultMatcher = m`<__Blank />`;
5
+
6
+ export const defaultMatcher = m`<__Blanks />`;
7
+
14
8
  export const grammar = class BlankSpaceGrammar {
15
- static {
16
- [_initProto] = _applyDecs(this, [[Node, 2, "Space"], [Node, 2, "LeftOffset"], [Node, 2, "Newline"], [Node, 2, "Indent"]], []).e;
17
- }
18
- constructor() {
19
- _initProto(this);
9
+ *Blanks() {
10
+ while (yield eatMatch(m`<Blank />`));
20
11
  }
12
+
21
13
  *Blank() {
22
- while (yield match(re`/[ \t\r\n]/`)) {
23
- if (yield match(re`/^/m`)) {
24
- yield eatMatch(m`<LeftOffset />`);
25
- yield eatMatch(m`<*Space />`);
26
- } else if (yield match(re`/[\r\n]/`)) {
27
- yield eat(m`<*Newline />`);
28
- } else {
29
- yield eat(m`<*Space />`, o({
30
- onlySameLine: true
31
- }));
32
- }
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 }));
33
21
  }
34
22
  }
35
- *Space({
36
- props: {
37
- onlySameLine
38
- }
39
- }) {
23
+
24
+ *Space({ props: { onlySameLine } }) {
40
25
  if (onlySameLine) {
41
26
  yield eat(re`/[ \t]+/`);
42
27
  } else {
43
28
  yield eat(re`/[ \t\r\n]+/`);
44
29
  }
45
30
  }
31
+
46
32
  *LeftOffset() {
47
- while (yield eatMatch(m`indents[]: <*Indent /\t| / />`));
33
+ while (yield eatMatch(m`indents[]: <*Indent /\t| / />`, o({}), o({ literal: true }))) {}
48
34
  }
35
+
49
36
  *Newline() {
50
37
  yield eat(re`/\r?\n?/`);
51
38
  }
39
+
52
40
  *Indent() {
53
41
  yield eat(re`/\t| /`);
54
42
  }
55
- };
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.9.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
- "@babel/runtime": "7.28.2",
24
- "@bablr/helpers": "0.24.0",
25
- "@bablr/agast-helpers": "0.9.0",
26
- "@bablr/agast-vm-helpers": "0.9.0",
27
- "@bablr/boot": "0.10.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": "git@github.com:bablr-lang/language-en-blank-space.git",
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"
@@ -1,46 +0,0 @@
1
- import { re, spam as m } from '@bablr/boot';
2
- import { o, eat, match, eatMatch } 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 defaultMatcher = m`<__Blank />`;
8
-
9
- export const grammar = class BlankSpaceGrammar {
10
- *Blank() {
11
- while (yield match(re`/[ \t\r\n]/`)) {
12
- if (yield match(re`/^/m`)) {
13
- yield eatMatch(m`<LeftOffset />`);
14
- yield eatMatch(m`<*Space />`);
15
- } else if (yield match(re`/[\r\n]/`)) {
16
- yield eat(m`<*Newline />`);
17
- } else {
18
- yield eat(m`<*Space />`, o({ onlySameLine: true }));
19
- }
20
- }
21
- }
22
-
23
- @Node
24
- *Space({ props: { onlySameLine } }) {
25
- if (onlySameLine) {
26
- yield eat(re`/[ \t]+/`);
27
- } else {
28
- yield eat(re`/[ \t\r\n]+/`);
29
- }
30
- }
31
-
32
- @Node
33
- *LeftOffset() {
34
- while (yield eatMatch(m`indents[]: <*Indent /\t| / />`));
35
- }
36
-
37
- @Node
38
- *Newline() {
39
- yield eat(re`/\r?\n?/`);
40
- }
41
-
42
- @Node
43
- *Indent() {
44
- yield eat(re`/\t| /`);
45
- }
46
- };