From 91ae576296df72defa2bb9369ac1cfe719f6f9cf Mon Sep 17 00:00:00 2001 From: Malte Voos Date: Tue, 9 Jul 2024 00:18:52 +0200 Subject: rename Ident -> Name part 2 --- src/ast/Ast.ml | 6 +++--- src/parser/Grammar.mly | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/ast/Ast.ml b/src/ast/Ast.ml index bbf3e93..3e87776 100644 --- a/src/ast/Ast.ml +++ b/src/ast/Ast.ml @@ -1,4 +1,4 @@ -type ident = Name.t Asai.Range.located +type name = Name.t Asai.Range.located type local_name = Name.local Asai.Range.located type arg = local_name * expr @@ -31,7 +31,7 @@ and expr = raw_expr Asai.Range.located type item = | Def of { - name : ident; + name : name; args : arg List.t; tp : expr; tm : expr; @@ -39,7 +39,7 @@ type item = type file = item List.t -let dump_ident fmt ({ value; _ } : ident) = Name.pp fmt value +let dump_name fmt ({ value; _ } : name) = Name.pp fmt value let dump_local_name fmt ({ value; _ } : local_name) = match value with | Some name -> Format.pp_print_string fmt name diff --git a/src/parser/Grammar.mly b/src/parser/Grammar.mly index 5e4886e..64f540d 100644 --- a/src/parser/Grammar.mly +++ b/src/parser/Grammar.mly @@ -25,10 +25,10 @@ open Ast %inline locate(X): e = X { Asai.Range.locate_lex ~source:(Eff.read()) $loc e } -raw_ident: id = separated_nonempty_list(DOT, IDENT) { id } +raw_name: id = separated_nonempty_list(DOT, IDENT) { id } %inline -ident: id = locate(raw_ident) { id } +name: name = locate(raw_name) { name } raw_local_name: | name = IDENT { Some name } @@ -40,7 +40,7 @@ arg: LPR; name = local_name; COLON; tp = expr; RPR { (name, tp) } raw_expr: - | name = raw_ident + | name = raw_name { Var name } | LPR; e = raw_expr; RPR { e } @@ -84,7 +84,7 @@ raw_expr: expr: e = locate(raw_expr) { e } item: - | DEF; name = ident; args = list(arg); COLON; tp = expr; ASSIGN; tm = expr + | DEF; name = name; args = list(arg); COLON; tp = expr; ASSIGN; tm = expr { Def { name; args; tp; tm } } file: items = list(item) { items } -- cgit 1.4.1