mirror of
https://github.com/Noratrieb/riverdelta.git
synced 2026-01-15 00:45:04 +01:00
some cleanup
This commit is contained in:
parent
5c6ade6cbb
commit
000f17b97e
6 changed files with 22 additions and 30 deletions
12
src/ast.ts
12
src/ast.ts
|
|
@ -266,16 +266,16 @@ export type Folder = {
|
|||
|
||||
export const DEFAULT_FOLDER: Folder = {
|
||||
item(item) {
|
||||
return super_fold_item(item, this);
|
||||
return superFoldItem(item, this);
|
||||
},
|
||||
expr(expr) {
|
||||
return super_fold_expr(expr, this);
|
||||
return superFoldExpr(expr, this);
|
||||
},
|
||||
ident(ident) {
|
||||
return ident;
|
||||
},
|
||||
type(type) {
|
||||
return super_fold_type(type, this);
|
||||
return superFoldType(type, this);
|
||||
},
|
||||
};
|
||||
|
||||
|
|
@ -283,7 +283,7 @@ export function fold_ast(ast: Ast, folder: Folder): Ast {
|
|||
return ast.map((item) => folder.item(item));
|
||||
}
|
||||
|
||||
export function super_fold_item(item: Item, folder: Folder): Item {
|
||||
export function superFoldItem(item: Item, folder: Folder): Item {
|
||||
switch (item.kind) {
|
||||
case "function": {
|
||||
const args = item.node.args.map(({ name, type, span }) => ({
|
||||
|
|
@ -307,7 +307,7 @@ export function super_fold_item(item: Item, folder: Folder): Item {
|
|||
}
|
||||
}
|
||||
|
||||
export function super_fold_expr(expr: Expr, folder: Folder): Expr {
|
||||
export function superFoldExpr(expr: Expr, folder: Folder): Expr {
|
||||
const span = expr.span;
|
||||
switch (expr.kind) {
|
||||
case "empty": {
|
||||
|
|
@ -373,7 +373,7 @@ export function super_fold_expr(expr: Expr, folder: Folder): Expr {
|
|||
}
|
||||
}
|
||||
|
||||
export function super_fold_type(type: Type, folder: Folder): Type {
|
||||
export function superFoldType(type: Type, folder: Folder): Type {
|
||||
const span = type.span;
|
||||
switch (type.kind) {
|
||||
case "ident": {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue