diff options
Diffstat (limited to 'typecheck.c')
| -rw-r--r-- | typecheck.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/typecheck.c b/typecheck.c index 6cc41216..43dec880 100644 --- a/typecheck.c +++ b/typecheck.c @@ -1326,14 +1326,8 @@ PUREFUNC bool is_constant(env_t *env, ast_t *ast) return is_constant(env, text->children->ast); } case TextLiteral: { - CORD literal = Match(ast, TextLiteral)->cord; - CORD_pos i; -#pragma GCC diagnostic ignored "-Wsign-conversion" - CORD_FOR(i, literal) { - if (!isascii(CORD_pos_fetch(i))) - return false; // Non-ASCII requires grapheme logic, not constant - } - return true; // Literal ASCII string, OK + Text_t text = Match(ast, TextLiteral)->text; + return (text.tag == TEXT_SHORT_ASCII || text.tag == TEXT_ASCII); } case Not: return is_constant(env, Match(ast, Not)->value); case Negative: return is_constant(env, Match(ast, Negative)->value); |
