From d17f48cf7fec15fa3da9d1eae1e4c3e2878e0b32 Mon Sep 17 00:00:00 2001 From: lisyarus Date: Wed, 1 Apr 2026 16:52:19 +0300 Subject: [PATCH] Fix some escape character literals & add a few more --- libs/parser/rules/pslang.l | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/libs/parser/rules/pslang.l b/libs/parser/rules/pslang.l index 41a6998..474c597 100644 --- a/libs/parser/rules/pslang.l +++ b/libs/parser/rules/pslang.l @@ -107,13 +107,20 @@ f64 { return bp::make_f64(ctx.location); } [0-9]+\.[0-9]+h { return bp::make_lit_f16(yytext, ctx.location); } [0-9]+\.[0-9]+d { return bp::make_lit_f64(yytext, ctx.location); } -'.' { return bp::make_lit_char8(yytext[1], ctx.location); } +'\\0' { return bp::make_lit_char8(0, ctx.location); } +'\\a' { return bp::make_lit_char8(7, ctx.location); } +'\\b' { return bp::make_lit_char8(8, ctx.location); } +'\\t' { return bp::make_lit_char8(9, ctx.location); } '\\n' { return bp::make_lit_char8(10, ctx.location); } -'\\t' { return bp::make_lit_char8(11, ctx.location); } +'\\v' { return bp::make_lit_char8(11, ctx.location); } +'\\f' { return bp::make_lit_char8(12, ctx.location); } '\\r' { return bp::make_lit_char8(13, ctx.location); } -'\\\"' { return bp::make_lit_char8(22, ctx.location); } -'\\'' { return bp::make_lit_char8(27, ctx.location); } -'\\\\' { return bp::make_lit_char8(134, ctx.location); } +'\\e' { return bp::make_lit_char8(27, ctx.location); } +'\\\"' { return bp::make_lit_char8(34, ctx.location); } +'\\'' { return bp::make_lit_char8(39, ctx.location); } +'\\?' { return bp::make_lit_char8(63, ctx.location); } +'\\\\' { return bp::make_lit_char8(92, ctx.location); } +'.' { return bp::make_lit_char8(yytext[1], ctx.location); } <> { return bp::make_end(ctx.location); }