Lots of work on the lua read-eval-print loop

This commit is contained in:
2026-05-21 18:41:09 -04:00
parent f7983b1f02
commit 2bfa3024f1
15 changed files with 70 additions and 120 deletions

View File

@@ -106,6 +106,14 @@ bool is_lua_classname(string_view s);
// Return true if the line of code is a lua comment.
bool is_lua_comment(string_view s);
// Return true if the line of code could be the beginning of a long expression.
// In a read-eval-print loop, if the user types something like "function foo",
// that's not a complete lua expression. But we don't want to just print an error,
// we want to give the user a chance to continue typing so that he can turn it
// into a complete lua expression. This function returns true if the string looks
// like the beginning of a long lua expression. This is only a heuristic.
bool is_possible_long_lua_expression(string_view s);
// Return true if the line is entirely whitespace.
bool is_whitespace(string_view s);