motoko 3.1.0 → 3.1.1

Sign up to get free protection for your applications and to get access to all the features.
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),