From 269c54058725d431dcc5b101e4fdb10f69626516 Mon Sep 17 00:00:00 2001 From: Alexander Bandukwala <7h3kk1d@gmail.com> Date: Thu, 10 Oct 2024 11:06:12 -0400 Subject: [PATCH] Fix potential_operator_regexp to allow for livelit invocation Co-authored-by: Gregory Croisdale --- src/haz3lcore/lang/Form.re | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/haz3lcore/lang/Form.re b/src/haz3lcore/lang/Form.re index 915a6fa1f2..aa7c9ab7bf 100644 --- a/src/haz3lcore/lang/Form.re +++ b/src/haz3lcore/lang/Form.re @@ -113,7 +113,7 @@ let is_keyword = match(keyword_regexp); /* Potential tokens: These are fallthrough classes which determine * the behavior when inserting a character in contact with a token */ -let is_potential_operand = match(regexp("^[a-zA-Z0-9_'\\.?]+$")); +let is_potential_operand = match(regexp("^[\\^a-zA-Z0-9_'\\.?]+$")); /* Anything else is considered a potential operator, as long * as it does not contain any whitespace, linebreaks, comment * delimiters, string delimiters, or the instant expanding paired @@ -151,8 +151,10 @@ let undefined = "undefined"; let is_undefined = match(regexp("^" ++ undefined ++ "$")); let is_livelit = str => { - let re = regexp("^(\\^)([A-Za-z0-9_]*)$"); + let re = regexp("^(\\^)([a-z][A-Za-z0-9_]*)$"); let result = match(re, str); + print_endline("is_livelit: " ++ str ++ " " ++ string_of_bool(result)); + result; }; let parse_livelit = str =>