Skip to content

Commit

Permalink
Fix potential_operator_regexp to allow for livelit invocation
Browse files Browse the repository at this point in the history
Co-authored-by: Gregory Croisdale <[email protected]>
  • Loading branch information
7h3kk1d and gcrois committed Oct 10, 2024
1 parent b9d437b commit 269c540
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/haz3lcore/lang/Form.re
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 =>
Expand Down

0 comments on commit 269c540

Please sign in to comment.