renommage pour bien voir avec la grammaire

This commit is contained in:
Mylloon 2023-10-24 15:12:10 +02:00
parent 7af9e7622f
commit 27696ecf09
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -73,7 +73,7 @@ definition:
DefineType (tc, tvl, Abstract)
}
/* Valeurs externes */
| EXTERN id=located(identifier) COLON ts=located(type_scheme) {
| EXTERN id=located(var_identifier) COLON ts=located(type_scheme) {
DeclareExtern(id, ts)
}
/* Définition de valeurs */
@ -112,14 +112,14 @@ list_ty:
}
label_with_type:
| l=located(label) COLON t=located(ty) {
| l=located(label_identifier) COLON t=located(ty) {
l, t
}
vdefinition:
/* Valeur simple */
| LET i=located(identifier) ts=option(colon_type_scheme)
| LET i=located(var_identifier) ts=option(colon_type_scheme)
EQUAL e=located(expression) %prec let1 {
SimpleValue(i, ts, e)
}
@ -133,7 +133,7 @@ vdefinition:
fundef:
| t=option(colon_type_scheme) i=located(identifier) p=located(pattern)
| t=option(colon_type_scheme) i=located(var_identifier) p=located(pattern)
EQUAL e=located(expression) %prec fun1 {
i, t, FunctionDefinition(p, e)
}
@ -157,7 +157,7 @@ branch:
simple_pattern:
/* Motif universel liant */
| i=located(identifier) {
| i=located(var_identifier) {
PVariable i
}
/* Motif universel non liant */
@ -183,7 +183,7 @@ simple_pattern:
/* Enregistrement */
| LBRACE l=separated_nonempty_list(
COMMA,
separated_pair(located(label), EQUAL, located(pattern))
separated_pair(located(label_identifier), EQUAL, located(pattern))
) RBRACE tl=option(type_list) {
PRecord(l, tl)
}
@ -278,7 +278,7 @@ simple_expression:
Literal l
}
/* Variable */
| i=located(identifier) tl=option(type_list) {
| i=located(var_identifier) tl=option(type_list) {
Variable(i, tl)
}
/* Tagged Value - Construction d'une donnée */
@ -297,7 +297,7 @@ simple_expression:
/* Record - Construction d'un enregistrement */
| LBRACE l=separated_nonempty_list(
COMMA,
separated_pair(located(label), EQUAL, located(expression))
separated_pair(located(label_identifier), EQUAL, located(expression))
) RBRACE tl=option(type_list) {
Record(l, tl)
}
@ -322,7 +322,7 @@ expression:
e
}
/* Field - Projection dun champ */
| e=located(expression) DOT l=located(label) tl=option(type_list) {
| e=located(expression) DOT l=located(label_identifier) tl=option(type_list) {
Field(e, l, tl)
}
/* Sequence - Séquencement *
@ -415,7 +415,7 @@ expression:
}
/* Boucle for - Boucle bornée
* for x in (e1 to e2) { expr } */
| FOR var=located(identifier)
| FOR var=located(var_identifier)
FROM LPAREN e1=located(expression) RPAREN
TO LPAREN e2=located(expression) RPAREN
LBRACE e3=located(expression) RBRACE {
@ -434,9 +434,9 @@ expression:
/******************************** BASIC TYPES *********************************/
identifier:
| i=ID {
Id i
var_identifier:
| var_id=ID {
Id var_id
}
type_variable:
@ -445,17 +445,17 @@ type_variable:
}
constructor:
| kid=CID {
KId kid
| constr_id=CID {
KId constr_id
}
type_constructor:
| tcon=ID {
TCon tcon
| type_con=ID {
TCon type_con
}
label:
label_identifier:
| label=ID {
LId label
}