From e42173cdbaeef9c0b83489747718e289cdb3b363 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Marie=20P=C3=A9drot?= Date: Thu, 5 Dec 2024 05:50:03 +0100 Subject: [PATCH] Allow quotes in identifiers. The documentation states that the precise specification of identifier syntax is intentionally vague. Yet I believe that one should be able to call arbitrary OCaml code from malfunction. For this to be possible, this means that all OCaml identifiers need to be valid malfunction identifier. As per the OCaml syntax, this means we have to allow single quotes in malfunction. --- src/malfunction_sexp.mll | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/malfunction_sexp.mll b/src/malfunction_sexp.mll index 8214e0c..82f4901 100644 --- a/src/malfunction_sexp.mll +++ b/src/malfunction_sexp.mll @@ -37,7 +37,7 @@ let letter = ['a'-'z' 'A'-'Z' '_'] let digit = ['0' - '9'] let atom = (letter | digit | symbol)* -let var = (['a'-'z' 'A'-'Z' '_' '0'-'9' '$'] | symbol)+ +let var = (['a'-'z' 'A'-'Z' '_' '0'-'9' '$' '\''] | symbol)+ let string = '"' ([^ '\\' '"']* | ('\\' _))* '"'