Skip to content

Commit c9befe9

Browse files
committed
Fix a small parsing edge case issue
1 parent e1085b6 commit c9befe9

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

src/parser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1460,7 +1460,7 @@ namespace Sass {
14601460
if (lex< sequence< dimension, optional< sequence< exactly<'-'>, negate< digit > > > > >())
14611461
{ return SASS_MEMORY_NEW(ctx.mem, Textual, pstate, Textual::DIMENSION, lexed); }
14621462

1463-
if (lex< sequence< static_component, one_plus< identifier > > >())
1463+
if (lex< sequence< static_component, one_plus< strict_identifier > > >())
14641464
{ return SASS_MEMORY_NEW(ctx.mem, String_Constant, pstate, lexed); }
14651465

14661466
if (lex< number >())

src/prelexer.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,16 @@ namespace Sass {
108108
>(src);
109109
}
110110

111+
// Match CSS identifiers.
112+
const char* strict_identifier(const char* src)
113+
{
114+
return sequence<
115+
one_plus < strict_identifier_alpha >,
116+
zero_plus < strict_identifier_alnum >
117+
// word_boundary not needed
118+
>(src);
119+
}
120+
111121
// Match CSS identifiers.
112122
const char* identifier(const char* src)
113123
{

src/prelexer.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ namespace Sass {
195195
const char* identifier(const char* src);
196196
const char* identifier_alpha(const char* src);
197197
const char* identifier_alnum(const char* src);
198+
const char* strict_identifier(const char* src);
198199
const char* strict_identifier_alpha(const char* src);
199200
const char* strict_identifier_alnum(const char* src);
200201
// Match a CSS unit identifier.

0 commit comments

Comments
 (0)