From: Jérémie Astor Date: Sun, 10 May 2020 15:48:46 +0000 (+0200) Subject: :art: Improve escape X-Git-Tag: nightly~1595 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=efe3226a4ce3033daf445fa7199157d3f88be2cf;p=gwion.git :art: Improve escape --- 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); }