@danielx/civet 0.2.9 → 0.2.10
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/README.md +25 -7
- package/dist/browser.js +52 -30
- package/dist/browser.js.map +2 -2
- package/dist/civet +12 -12
- package/dist/cli.js.map +3 -3
- package/dist/main.js +52 -30
- package/dist/types.d.ts +16 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -5,11 +5,18 @@ Civet
|
|
|
5
5
|
|
|
6
6
|
A new CoffeeScript. Much closer to ES2015+ (for better or worse).
|
|
7
7
|
|
|
8
|
-
Also TypeScript, the sky is the limit.
|
|
8
|
+
Also TypeScript, the sky is the limit. [Online Civet Playground](https://civet-web.vercel.app/)
|
|
9
|
+
|
|
10
|
+
Quickstart Guide
|
|
11
|
+
---
|
|
9
12
|
|
|
10
13
|
```bash
|
|
14
|
+
# Install
|
|
11
15
|
npm install -g @danielx/civet
|
|
16
|
+
# Compile civet source file to typescript
|
|
12
17
|
civet < source.civet > output.ts
|
|
18
|
+
# Execute a civet source file in node
|
|
19
|
+
node --loader @danielx/civet/register.mjs source.civet
|
|
13
20
|
```
|
|
14
21
|
|
|
15
22
|

|
|
@@ -20,7 +27,7 @@ Code Sample
|
|
|
20
27
|
```typescript
|
|
21
28
|
import ts, {CompilerOptions} from "typescript"
|
|
22
29
|
|
|
23
|
-
|
|
30
|
+
DefaultCompilerOptions : CompilerOptions :=
|
|
24
31
|
allowNonTsExtensions: true
|
|
25
32
|
allowJs: true
|
|
26
33
|
target: ts.ScriptTarget.Latest
|
|
@@ -29,13 +36,13 @@ const DefaultCompilerOptions : CompilerOptions =
|
|
|
29
36
|
allowSyntheticDefaultImports: true
|
|
30
37
|
experimentalDecorators: true
|
|
31
38
|
|
|
32
|
-
|
|
39
|
+
fileCache : Record<string, any> := {}
|
|
33
40
|
|
|
34
|
-
|
|
35
|
-
|
|
41
|
+
createCompilerHost := (options: CompilerOptions, moduleSearchLocations : string[]) ->
|
|
42
|
+
fileExists := (fileName: string) : boolean ->
|
|
36
43
|
return fileCache[fileName]?
|
|
37
44
|
|
|
38
|
-
|
|
45
|
+
readFile := (fileName: string) ->
|
|
39
46
|
return fileCache[fileName]
|
|
40
47
|
```
|
|
41
48
|
|
|
@@ -46,6 +53,7 @@ Things Kept from CoffeeScript
|
|
|
46
53
|
- `or` -> `||`
|
|
47
54
|
- `and` -> `&&`
|
|
48
55
|
- `loop` -> `while(true)`
|
|
56
|
+
- `unless` conditional (without the `else`)
|
|
49
57
|
- Object literal syntax
|
|
50
58
|
```coffee
|
|
51
59
|
x =
|
|
@@ -65,19 +73,25 @@ Things Kept from CoffeeScript
|
|
|
65
73
|
- TODO
|
|
66
74
|
- [ ] `"""` Strings (for compatibility with existing .coffee code)
|
|
67
75
|
- [ ] Chained comparisons
|
|
76
|
+
- [ ] `until`
|
|
77
|
+
- [ ] Prototype shorthand `X::` -> `X.prototype`, `X::a` -> `X.prototype.a`
|
|
68
78
|
|
|
69
79
|
Things Removed from CoffeeScript
|
|
70
80
|
---
|
|
71
81
|
|
|
72
82
|
- `on/yes/off/no` (use `true/false`)
|
|
83
|
+
- `isnt` (use `!==`)
|
|
84
|
+
- `not` (use `!`)
|
|
73
85
|
- `do` keyword (replaced with JS `do`)
|
|
74
86
|
- `for from` (use JS `for of`)
|
|
75
87
|
- Array slices `list[0...2]` (use `list.slice(0, 2)`)
|
|
88
|
+
- Slice assignment `numbers[3..6] = [-3, -4, -5, -6]`
|
|
76
89
|
- Comprensions (a case could be made for keeping them)
|
|
77
90
|
- Iteration expression results
|
|
78
91
|
- Implicit declarations
|
|
79
92
|
- Implicit returns (will probably add later)
|
|
80
93
|
- Rest parameter in any assignment position (might add later)
|
|
94
|
+
- Postfix `while/until`
|
|
81
95
|
- `///` Heregexp
|
|
82
96
|
- Embedded JS
|
|
83
97
|
|
|
@@ -92,10 +106,15 @@ Things Changed from CoffeeScript
|
|
|
92
106
|
- Existential `x?` -> `(x != null)` no longer checks for undeclared variables.
|
|
93
107
|
- Embedded JS `\`\`` has been replaced with JS template literals.
|
|
94
108
|
- No longer allowing multiple postfix `if/unless` on the same line.
|
|
109
|
+
- No `else` block on `unless` (negate condition and use `if`)
|
|
110
|
+
- Civet tries to keep the transpiled output verbatim as much as possible.
|
|
111
|
+
In Coffee `(x)` -> `x;` but in Civet `(x)` -> `(x);`.
|
|
112
|
+
Also in Coffee `x + 3` -> `x + 3` but in Civet `x + 3` remains as is.
|
|
95
113
|
|
|
96
114
|
Things Added that CoffeeScript didn't
|
|
97
115
|
---
|
|
98
116
|
|
|
117
|
+
- TypeScript Types
|
|
99
118
|
- JS Compatability
|
|
100
119
|
- `var`, `let`, `const`
|
|
101
120
|
- JS Comment Syntax `//` and `/* */`
|
|
@@ -117,7 +136,6 @@ Things Added that CoffeeScript didn't
|
|
|
117
136
|
#!./node_modules/.bin/ts-node
|
|
118
137
|
console.log "hi"
|
|
119
138
|
```
|
|
120
|
-
- TypeScript Types
|
|
121
139
|
|
|
122
140
|
Things Changed from ES6
|
|
123
141
|
---
|
package/dist/browser.js
CHANGED
|
@@ -538,6 +538,8 @@ var Civet = (() => {
|
|
|
538
538
|
ModuleSpecifier,
|
|
539
539
|
ImportedBinding,
|
|
540
540
|
ExportDeclaration,
|
|
541
|
+
As,
|
|
542
|
+
Export,
|
|
541
543
|
ExportFromClause,
|
|
542
544
|
NamedExports,
|
|
543
545
|
ExportSpecifier,
|
|
@@ -1985,8 +1987,8 @@ var Civet = (() => {
|
|
|
1985
1987
|
return IterationStatement$0(state) || IterationStatement$1(state) || IterationStatement$2(state) || IterationStatement$3(state) || IterationStatement$4(state);
|
|
1986
1988
|
}
|
|
1987
1989
|
}
|
|
1988
|
-
var LoopStatement$0 = $TS($S($EXPECT($L89, fail, 'LoopStatement "loop"'), Block), function($skip, $loc, $0, $1, $2) {
|
|
1989
|
-
var b = $
|
|
1990
|
+
var LoopStatement$0 = $TS($S($EXPECT($L89, fail, 'LoopStatement "loop"'), NonIdContinue, Block), function($skip, $loc, $0, $1, $2, $3) {
|
|
1991
|
+
var b = $3;
|
|
1990
1992
|
return ["while(true)", b];
|
|
1991
1993
|
});
|
|
1992
1994
|
function LoopStatement(state) {
|
|
@@ -1998,7 +2000,7 @@ var Civet = (() => {
|
|
|
1998
2000
|
return LoopStatement$0(state);
|
|
1999
2001
|
}
|
|
2000
2002
|
}
|
|
2001
|
-
var DoWhileStatement$0 = $S($EXPECT($L90, fail, 'DoWhileStatement "do"'), Block, __, $EXPECT($L91, fail, 'DoWhileStatement "while"'), Condition);
|
|
2003
|
+
var DoWhileStatement$0 = $S($EXPECT($L90, fail, 'DoWhileStatement "do"'), NonIdContinue, Block, __, $EXPECT($L91, fail, 'DoWhileStatement "while"'), Condition);
|
|
2002
2004
|
function DoWhileStatement(state) {
|
|
2003
2005
|
if (state.verbose)
|
|
2004
2006
|
console.log("ENTER:", "DoWhileStatement");
|
|
@@ -2008,7 +2010,7 @@ var Civet = (() => {
|
|
|
2008
2010
|
return DoWhileStatement$0(state);
|
|
2009
2011
|
}
|
|
2010
2012
|
}
|
|
2011
|
-
var WhileStatement$0 = $S($EXPECT($L91, fail, 'WhileStatement "while"'), Condition, Block);
|
|
2013
|
+
var WhileStatement$0 = $S($EXPECT($L91, fail, 'WhileStatement "while"'), NonIdContinue, Condition, Block);
|
|
2012
2014
|
function WhileStatement(state) {
|
|
2013
2015
|
if (state.verbose)
|
|
2014
2016
|
console.log("ENTER:", "WhileStatement");
|
|
@@ -2018,7 +2020,7 @@ var Civet = (() => {
|
|
|
2018
2020
|
return WhileStatement$0(state);
|
|
2019
2021
|
}
|
|
2020
2022
|
}
|
|
2021
|
-
var ForStatement$0 = $S($EXPECT($L92, fail, 'ForStatement "for"'), __, $EXPECT($L1, fail, 'ForStatement "("'), __, $C(LexicalDeclaration, VariableStatement, $E(Expression)), __, $EXPECT($L87, fail, 'ForStatement ";"'), __, $E(Expression), $EXPECT($L87, fail, 'ForStatement ";"'), __, $E(Expression), $EXPECT($L2, fail, 'ForStatement ")"'), Block);
|
|
2023
|
+
var ForStatement$0 = $S($EXPECT($L92, fail, 'ForStatement "for"'), NonIdContinue, __, $EXPECT($L1, fail, 'ForStatement "("'), __, $C(LexicalDeclaration, VariableStatement, $E(Expression)), __, $EXPECT($L87, fail, 'ForStatement ";"'), __, $E(Expression), $EXPECT($L87, fail, 'ForStatement ";"'), __, $E(Expression), $EXPECT($L2, fail, 'ForStatement ")"'), Block);
|
|
2022
2024
|
function ForStatement(state) {
|
|
2023
2025
|
if (state.verbose)
|
|
2024
2026
|
console.log("ENTER:", "ForStatement");
|
|
@@ -2028,10 +2030,10 @@ var Civet = (() => {
|
|
|
2028
2030
|
return ForStatement$0(state);
|
|
2029
2031
|
}
|
|
2030
2032
|
}
|
|
2031
|
-
var ForInOfStatement$0 = $S($EXPECT($L92, fail, 'ForInOfStatement "for"'), __, $EXPECT($L1, fail, 'ForInOfStatement "("'), __, $C($S($EXPECT($L93, fail, 'ForInOfStatement "var"'), __, ForBinding), ForDeclaration, LeftHandSideExpression), __, $EXPECT($L78, fail, 'ForInOfStatement "in"'), __, Expression, __, $EXPECT($L2, fail, 'ForInOfStatement ")"'), Block);
|
|
2032
|
-
var ForInOfStatement$1 = $S($EXPECT($L92, fail, 'ForInOfStatement "for"'), __, InsertOpenParen, $C($S($EXPECT($L93, fail, 'ForInOfStatement "var"'), __, ForBinding), ForDeclaration, LeftHandSideExpression), __, $EXPECT($L78, fail, 'ForInOfStatement "in"'), __, Expression, InsertCloseParen, Block);
|
|
2033
|
-
var ForInOfStatement$2 = $S($EXPECT($L92, fail, 'ForInOfStatement "for"'), $E($S(__, $EXPECT($L94, fail, 'ForInOfStatement "await"'))), __, $EXPECT($L1, fail, 'ForInOfStatement "("'), __, $C($S($EXPECT($L93, fail, 'ForInOfStatement "var"'), __, ForBinding), ForDeclaration, LeftHandSideExpression), __, $EXPECT($L95, fail, 'ForInOfStatement "of"'), AssignmentExpression, __, $EXPECT($L2, fail, 'ForInOfStatement ")"'), Block);
|
|
2034
|
-
var ForInOfStatement$3 = $S($EXPECT($L92, fail, 'ForInOfStatement "for"'), $E($S(__, $EXPECT($L94, fail, 'ForInOfStatement "await"'))), __, InsertOpenParen, $C($S($EXPECT($L93, fail, 'ForInOfStatement "var"'), __, ForBinding), ForDeclaration, LeftHandSideExpression), __, $EXPECT($L95, fail, 'ForInOfStatement "of"'), AssignmentExpression, InsertCloseParen, Block);
|
|
2033
|
+
var ForInOfStatement$0 = $S($EXPECT($L92, fail, 'ForInOfStatement "for"'), NonIdContinue, __, $EXPECT($L1, fail, 'ForInOfStatement "("'), __, $C($S($EXPECT($L93, fail, 'ForInOfStatement "var"'), __, ForBinding), ForDeclaration, LeftHandSideExpression), __, $EXPECT($L78, fail, 'ForInOfStatement "in"'), __, Expression, __, $EXPECT($L2, fail, 'ForInOfStatement ")"'), Block);
|
|
2034
|
+
var ForInOfStatement$1 = $S($EXPECT($L92, fail, 'ForInOfStatement "for"'), NonIdContinue, __, InsertOpenParen, $C($S($EXPECT($L93, fail, 'ForInOfStatement "var"'), __, ForBinding), ForDeclaration, LeftHandSideExpression), __, $EXPECT($L78, fail, 'ForInOfStatement "in"'), __, Expression, InsertCloseParen, Block);
|
|
2035
|
+
var ForInOfStatement$2 = $S($EXPECT($L92, fail, 'ForInOfStatement "for"'), NonIdContinue, $E($S(__, $EXPECT($L94, fail, 'ForInOfStatement "await"'))), __, $EXPECT($L1, fail, 'ForInOfStatement "("'), __, $C($S($EXPECT($L93, fail, 'ForInOfStatement "var"'), __, ForBinding), ForDeclaration, LeftHandSideExpression), __, $EXPECT($L95, fail, 'ForInOfStatement "of"'), AssignmentExpression, __, $EXPECT($L2, fail, 'ForInOfStatement ")"'), Block);
|
|
2036
|
+
var ForInOfStatement$3 = $S($EXPECT($L92, fail, 'ForInOfStatement "for"'), NonIdContinue, $E($S(__, $EXPECT($L94, fail, 'ForInOfStatement "await"'))), __, InsertOpenParen, $C($S($EXPECT($L93, fail, 'ForInOfStatement "var"'), __, ForBinding), ForDeclaration, LeftHandSideExpression), __, $EXPECT($L95, fail, 'ForInOfStatement "of"'), AssignmentExpression, InsertCloseParen, Block);
|
|
2035
2037
|
function ForInOfStatement(state) {
|
|
2036
2038
|
if (state.tokenize) {
|
|
2037
2039
|
return $TOKEN("ForInOfStatement", state, ForInOfStatement$0(state) || ForInOfStatement$1(state) || ForInOfStatement$2(state) || ForInOfStatement$3(state));
|
|
@@ -2039,7 +2041,7 @@ var Civet = (() => {
|
|
|
2039
2041
|
return ForInOfStatement$0(state) || ForInOfStatement$1(state) || ForInOfStatement$2(state) || ForInOfStatement$3(state);
|
|
2040
2042
|
}
|
|
2041
2043
|
}
|
|
2042
|
-
var ForDeclaration$0 = $S($C($EXPECT($L96, fail, 'ForDeclaration "let"'), $EXPECT($L97, fail, 'ForDeclaration "const"')), __, ForBinding);
|
|
2044
|
+
var ForDeclaration$0 = $S($C($EXPECT($L96, fail, 'ForDeclaration "let"'), $EXPECT($L97, fail, 'ForDeclaration "const"')), NonIdContinue, __, ForBinding);
|
|
2043
2045
|
function ForDeclaration(state) {
|
|
2044
2046
|
if (state.verbose)
|
|
2045
2047
|
console.log("ENTER:", "ForDeclaration");
|
|
@@ -2058,7 +2060,7 @@ var Civet = (() => {
|
|
|
2058
2060
|
return ForBinding$0(state) || ForBinding$1(state);
|
|
2059
2061
|
}
|
|
2060
2062
|
}
|
|
2061
|
-
var SwitchStatement$0 = $S($EXPECT($L98, fail, 'SwitchStatement "switch"'), Condition, CaseBlock);
|
|
2063
|
+
var SwitchStatement$0 = $S($EXPECT($L98, fail, 'SwitchStatement "switch"'), NonIdContinue, Condition, CaseBlock);
|
|
2062
2064
|
function SwitchStatement(state) {
|
|
2063
2065
|
if (state.verbose)
|
|
2064
2066
|
console.log("ENTER:", "SwitchStatement");
|
|
@@ -2102,9 +2104,9 @@ var Civet = (() => {
|
|
|
2102
2104
|
return NestedCaseClause$0(state);
|
|
2103
2105
|
}
|
|
2104
2106
|
}
|
|
2105
|
-
var CaseClause$0 = $S($EXPECT($L99, fail, 'CaseClause "case"'), $Q(_), Expression, ImpliedColon, NestedBlockExpressions);
|
|
2107
|
+
var CaseClause$0 = $S($EXPECT($L99, fail, 'CaseClause "case"'), NonIdContinue, $Q(_), Expression, ImpliedColon, NestedBlockExpressions);
|
|
2106
2108
|
var CaseClause$1 = $S(When, $Q(_), Expression, ImpliedColon, NestedBlockExpressions, InsertBreak);
|
|
2107
|
-
var CaseClause$2 = $S($EXPECT($L100, fail, 'CaseClause "default"'), ImpliedColon, NestedBlockExpressions);
|
|
2109
|
+
var CaseClause$2 = $S($EXPECT($L100, fail, 'CaseClause "default"'), NonIdContinue, ImpliedColon, NestedBlockExpressions);
|
|
2108
2110
|
function CaseClause(state) {
|
|
2109
2111
|
if (state.tokenize) {
|
|
2110
2112
|
return $TOKEN("CaseClause", state, CaseClause$0(state) || CaseClause$1(state) || CaseClause$2(state));
|
|
@@ -2112,7 +2114,7 @@ var Civet = (() => {
|
|
|
2112
2114
|
return CaseClause$0(state) || CaseClause$1(state) || CaseClause$2(state);
|
|
2113
2115
|
}
|
|
2114
2116
|
}
|
|
2115
|
-
var When$0 = $T($EXPECT($L101, fail, 'When "when"'), function(value) {
|
|
2117
|
+
var When$0 = $T($S($EXPECT($L101, fail, 'When "when"'), NonIdContinue), function(value) {
|
|
2116
2118
|
return "case";
|
|
2117
2119
|
});
|
|
2118
2120
|
function When(state) {
|
|
@@ -2209,12 +2211,12 @@ var Civet = (() => {
|
|
|
2209
2211
|
return ExpressionStatement$0(state);
|
|
2210
2212
|
}
|
|
2211
2213
|
}
|
|
2212
|
-
var KeywordStatement$0 = $EXPECT($L105, fail, 'KeywordStatement "break"');
|
|
2213
|
-
var KeywordStatement$1 = $EXPECT($L106, fail, 'KeywordStatement "continue"');
|
|
2214
|
-
var KeywordStatement$2 = $EXPECT($L107, fail, 'KeywordStatement "debugger"');
|
|
2215
|
-
var KeywordStatement$3 = $S($EXPECT($L108, fail, 'KeywordStatement "return"'), Expression);
|
|
2216
|
-
var KeywordStatement$4 = $EXPECT($L108, fail, 'KeywordStatement "return"');
|
|
2217
|
-
var KeywordStatement$5 = $S($EXPECT($L109, fail, 'KeywordStatement "throw"'), Expression);
|
|
2214
|
+
var KeywordStatement$0 = $S($EXPECT($L105, fail, 'KeywordStatement "break"'), NonIdContinue);
|
|
2215
|
+
var KeywordStatement$1 = $S($EXPECT($L106, fail, 'KeywordStatement "continue"'), NonIdContinue);
|
|
2216
|
+
var KeywordStatement$2 = $S($EXPECT($L107, fail, 'KeywordStatement "debugger"'), NonIdContinue);
|
|
2217
|
+
var KeywordStatement$3 = $S($EXPECT($L108, fail, 'KeywordStatement "return"'), NonIdContinue, Expression);
|
|
2218
|
+
var KeywordStatement$4 = $S($EXPECT($L108, fail, 'KeywordStatement "return"'), NonIdContinue);
|
|
2219
|
+
var KeywordStatement$5 = $S($EXPECT($L109, fail, 'KeywordStatement "throw"'), NonIdContinue, Expression);
|
|
2218
2220
|
function KeywordStatement(state) {
|
|
2219
2221
|
if (state.tokenize) {
|
|
2220
2222
|
return $TOKEN("KeywordStatement", state, KeywordStatement$0(state) || KeywordStatement$1(state) || KeywordStatement$2(state) || KeywordStatement$3(state) || KeywordStatement$4(state) || KeywordStatement$5(state));
|
|
@@ -2222,11 +2224,11 @@ var Civet = (() => {
|
|
|
2222
2224
|
return KeywordStatement$0(state) || KeywordStatement$1(state) || KeywordStatement$2(state) || KeywordStatement$3(state) || KeywordStatement$4(state) || KeywordStatement$5(state);
|
|
2223
2225
|
}
|
|
2224
2226
|
}
|
|
2225
|
-
var ImportDeclaration$0 = $T($S($EXPECT($L110, fail, 'ImportDeclaration "import type"'), __, ImportClause, __, FromClause), function(value) {
|
|
2227
|
+
var ImportDeclaration$0 = $T($S($EXPECT($L110, fail, 'ImportDeclaration "import type"'), NonIdContinue, __, ImportClause, __, FromClause), function(value) {
|
|
2226
2228
|
return { "ts": true, "children": value };
|
|
2227
2229
|
});
|
|
2228
|
-
var ImportDeclaration$1 = $S($EXPECT($L23, fail, 'ImportDeclaration "import"'), __, ImportClause, __, FromClause);
|
|
2229
|
-
var ImportDeclaration$2 = $S($EXPECT($L23, fail, 'ImportDeclaration "import"'), __, ModuleSpecifier);
|
|
2230
|
+
var ImportDeclaration$1 = $S($EXPECT($L23, fail, 'ImportDeclaration "import"'), NonIdContinue, __, ImportClause, __, FromClause);
|
|
2231
|
+
var ImportDeclaration$2 = $S($EXPECT($L23, fail, 'ImportDeclaration "import"'), NonIdContinue, __, ModuleSpecifier);
|
|
2230
2232
|
function ImportDeclaration(state) {
|
|
2231
2233
|
if (state.tokenize) {
|
|
2232
2234
|
return $TOKEN("ImportDeclaration", state, ImportDeclaration$0(state) || ImportDeclaration$1(state) || ImportDeclaration$2(state));
|
|
@@ -2244,7 +2246,7 @@ var Civet = (() => {
|
|
|
2244
2246
|
return ImportClause$0(state) || ImportClause$1(state) || ImportClause$2(state);
|
|
2245
2247
|
}
|
|
2246
2248
|
}
|
|
2247
|
-
var NameSpaceImport$0 = $S($EXPECT($L9, fail, 'NameSpaceImport "*"'), __, $EXPECT($L4, fail, 'NameSpaceImport "as"'), __, ImportedBinding);
|
|
2249
|
+
var NameSpaceImport$0 = $S($EXPECT($L9, fail, 'NameSpaceImport "*"'), __, $EXPECT($L4, fail, 'NameSpaceImport "as"'), NonIdContinue, __, ImportedBinding);
|
|
2248
2250
|
function NameSpaceImport(state) {
|
|
2249
2251
|
if (state.verbose)
|
|
2250
2252
|
console.log("ENTER:", "NameSpaceImport");
|
|
@@ -2264,7 +2266,7 @@ var Civet = (() => {
|
|
|
2264
2266
|
return NamedImports$0(state);
|
|
2265
2267
|
}
|
|
2266
2268
|
}
|
|
2267
|
-
var FromClause$0 = $S($EXPECT($L111, fail, 'FromClause "from"'), __, ModuleSpecifier);
|
|
2269
|
+
var FromClause$0 = $S($EXPECT($L111, fail, 'FromClause "from"'), NonIdContinue, __, ModuleSpecifier);
|
|
2268
2270
|
function FromClause(state) {
|
|
2269
2271
|
if (state.verbose)
|
|
2270
2272
|
console.log("ENTER:", "FromClause");
|
|
@@ -2274,7 +2276,7 @@ var Civet = (() => {
|
|
|
2274
2276
|
return FromClause$0(state);
|
|
2275
2277
|
}
|
|
2276
2278
|
}
|
|
2277
|
-
var ImportSpecifier$0 = $S(__, ModuleExportName, __, $EXPECT($L4, fail, 'ImportSpecifier "as"'), __, ImportedBinding, ObjectPropertyDelimiter);
|
|
2279
|
+
var ImportSpecifier$0 = $S(__, ModuleExportName, __, $EXPECT($L4, fail, 'ImportSpecifier "as"'), NonIdContinue, __, ImportedBinding, ObjectPropertyDelimiter);
|
|
2278
2280
|
var ImportSpecifier$1 = $S(__, ImportedBinding, ObjectPropertyDelimiter);
|
|
2279
2281
|
function ImportSpecifier(state) {
|
|
2280
2282
|
if (state.tokenize) {
|
|
@@ -2312,9 +2314,9 @@ var Civet = (() => {
|
|
|
2312
2314
|
return ImportedBinding$0(state);
|
|
2313
2315
|
}
|
|
2314
2316
|
}
|
|
2315
|
-
var ExportDeclaration$0 = $S(
|
|
2316
|
-
var ExportDeclaration$1 = $S(
|
|
2317
|
-
var ExportDeclaration$2 = $S(
|
|
2317
|
+
var ExportDeclaration$0 = $S(Export, __, $EXPECT($L100, fail, 'ExportDeclaration "default"'), NonIdContinue, __, $C(HoistableDeclaration, ClassDeclaration, AssignmentExpression));
|
|
2318
|
+
var ExportDeclaration$1 = $S(Export, __, ExportFromClause, __, FromClause);
|
|
2319
|
+
var ExportDeclaration$2 = $S(Export, __, $C(NamedExports, VariableStatement, Declaration));
|
|
2318
2320
|
function ExportDeclaration(state) {
|
|
2319
2321
|
if (state.tokenize) {
|
|
2320
2322
|
return $TOKEN("ExportDeclaration", state, ExportDeclaration$0(state) || ExportDeclaration$1(state) || ExportDeclaration$2(state));
|
|
@@ -2322,7 +2324,27 @@ var Civet = (() => {
|
|
|
2322
2324
|
return ExportDeclaration$0(state) || ExportDeclaration$1(state) || ExportDeclaration$2(state);
|
|
2323
2325
|
}
|
|
2324
2326
|
}
|
|
2325
|
-
var
|
|
2327
|
+
var As$0 = $S($EXPECT($L4, fail, 'As "as"'), NonIdContinue);
|
|
2328
|
+
function As(state) {
|
|
2329
|
+
if (state.verbose)
|
|
2330
|
+
console.log("ENTER:", "As");
|
|
2331
|
+
if (state.tokenize) {
|
|
2332
|
+
return $TOKEN("As", state, As$0(state));
|
|
2333
|
+
} else {
|
|
2334
|
+
return As$0(state);
|
|
2335
|
+
}
|
|
2336
|
+
}
|
|
2337
|
+
var Export$0 = $S($EXPECT($L112, fail, 'Export "export"'), NonIdContinue);
|
|
2338
|
+
function Export(state) {
|
|
2339
|
+
if (state.verbose)
|
|
2340
|
+
console.log("ENTER:", "Export");
|
|
2341
|
+
if (state.tokenize) {
|
|
2342
|
+
return $TOKEN("Export", state, Export$0(state));
|
|
2343
|
+
} else {
|
|
2344
|
+
return Export$0(state);
|
|
2345
|
+
}
|
|
2346
|
+
}
|
|
2347
|
+
var ExportFromClause$0 = $S($EXPECT($L9, fail, 'ExportFromClause "*"'), $E($S(__, $EXPECT($L4, fail, 'ExportFromClause "as"'), NonIdContinue, __, ModuleExportName)));
|
|
2326
2348
|
var ExportFromClause$1 = NamedExports;
|
|
2327
2349
|
function ExportFromClause(state) {
|
|
2328
2350
|
if (state.tokenize) {
|