From efe3226a4ce3033daf445fa7199157d3f88be2cf Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Sun, 10 May 2020 17:48:46 +0200 Subject: [PATCH] :art: Improve escape --- include/escape.h | 2 +- src/emit/emit.c | 2 +- src/emit/escape.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/escape.h b/include/escape.h index fcf4b7cb..463f5661 100644 --- a/include/escape.h +++ b/include/escape.h @@ -1,6 +1,6 @@ #ifndef __ESCAPE #define __ESCAPE char* escape_table(MemPool); -ANN m_int str2char(const Emitter, const m_str, const loc_t); +ANN char str2char(const Emitter, const m_str, const loc_t); ANN m_bool escape_str(const Emitter, m_str, const loc_t); #endif diff --git a/src/emit/emit.c b/src/emit/emit.c index 90940c0a..ba1fc873 100644 --- a/src/emit/emit.c +++ b/src/emit/emit.c @@ -453,7 +453,7 @@ ANN static m_bool emit_prim_float(const Emitter emit, const m_float *fnum) { } ANN static m_bool emit_prim_char(const Emitter emit, const m_str *str) { - DECL_BB(const m_int, c, = str2char(emit, *str, prim_pos(str))) + const char c = str2char(emit, *str, prim_pos(str)); regpushi(emit, c); return GW_OK; } diff --git a/src/emit/escape.c b/src/emit/escape.c index 3bef0a78..62d0ce79 100644 --- a/src/emit/escape.c +++ b/src/emit/escape.c @@ -72,6 +72,6 @@ m_bool escape_str(const Emitter emit, const m_str base, const loc_t pos) { return GW_OK; } -ANN m_int str2char(const Emitter emit, const m_str c, const loc_t pos) { +ANN char str2char(const Emitter emit, const m_str c, const loc_t pos) { return c[0] != '\\' ? c[0] : get_escape(emit, c[1], pos); } -- 2.43.0