From 7ccfaca60affbcfdfc4a0e6941f80d8c1115afab Mon Sep 17 00:00:00 2001 From: Marcel Greter Date: Sat, 13 Jun 2015 17:54:45 +0200 Subject: [PATCH] Fix parsing edge case with numbers and trailing escapes Fixes https://github.com/sass/libsass/issues/1219 --- parser.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/parser.cpp b/parser.cpp index db38c2a1ed..98cdbf8b64 100644 --- a/parser.cpp +++ b/parser.cpp @@ -1333,8 +1333,7 @@ namespace Sass { if (lex< kwd_important >()) { return new (ctx.mem) String_Constant(pstate, "!important"); } - const char* stop; - if ((stop = peek< value_schema >())) + if (const char* stop = peek< value_schema >()) { return parse_value_schema(stop); } // string may be interpolated @@ -1365,6 +1364,9 @@ namespace Sass { if (lex< sequence< dimension, optional< sequence< exactly<'-'>, negate< digit > > > > >()) { return new (ctx.mem) Textual(pstate, Textual::DIMENSION, lexed); } + if (lex< sequence< static_component, one_plus< identifier > > >()) + { return new (ctx.mem) String_Constant(pstate, lexed); } + if (lex< number >()) { return new (ctx.mem) Textual(pstate, Textual::NUMBER, lexed); }