motoko 3.0.2 → 3.1.1
Sign up to get free protection for your applications and to get access to all the features.
- package/contrib/monaco.js +30 -1
- package/contrib/snippets.json +425 -0
- package/lib/ast.d.ts +1 -0
- package/lib/ast.d.ts.map +1 -1
- package/lib/ast.js +6 -0
- package/lib/ast.js.map +1 -1
- package/package.json +2 -2
- package/packages/latest/base.json +1 -1
- package/src/ast.ts +10 -0
- package/versions/latest/moc.min.js +1 -1
- package/versions/latest/moc_interpreter.min.js +1 -1
package/src/ast.ts
CHANGED
@@ -18,6 +18,7 @@ export interface Source {
|
|
18
18
|
export interface Node extends Partial<Source> {
|
19
19
|
name: string;
|
20
20
|
type?: string;
|
21
|
+
doc?: string;
|
21
22
|
declaration?: Source;
|
22
23
|
args?: AST[];
|
23
24
|
}
|
@@ -61,6 +62,15 @@ export function simplifyAST(ast: CompilerAST): AST {
|
|
61
62
|
type,
|
62
63
|
};
|
63
64
|
}
|
65
|
+
if (ast.name === '*') {
|
66
|
+
const [doc, docAst] = ast.args as [string, CompilerAST];
|
67
|
+
return {
|
68
|
+
...(typeof docAst === 'string'
|
69
|
+
? { name: docAst }
|
70
|
+
: simplifyAST(docAst)),
|
71
|
+
doc,
|
72
|
+
};
|
73
|
+
}
|
64
74
|
return {
|
65
75
|
name: ast.name,
|
66
76
|
args: simplifyAST(ast.args),
|