Skip to content

Commit

Permalink
Merge pull request sass#747 from xzyfer/wip/cleanup-modulo-todos
Browse files Browse the repository at this point in the history
Fix some recently introduced TODOs
  • Loading branch information
xzyfer committed Dec 22, 2014
2 parents 965e472 + b9a75d7 commit 86f56b2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 17 deletions.
4 changes: 1 addition & 3 deletions parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1136,9 +1136,7 @@ namespace Sass {
if (lex< important >())
{ return new (ctx.mem) String_Constant(path, source_position, "!important"); }

// #TODO: Use the uncommented version when #745 is fixed
// if (lex< value_schema >())
if (lex< sequence< value_schema, optional< exactly<'%'> > > >())
if (lex< value_schema >())
{ return Parser::from_token(lexed, ctx, path, source_position).parse_value_schema(); }

if (lex< sequence< true_val, negate< identifier > > >())
Expand Down
8 changes: 4 additions & 4 deletions prelexer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,16 +183,16 @@ namespace Sass {
// Match interpolant schemas
const char* identifier_schema(const char* src) {
// follows this pattern: (x*ix*)+ ... well, not quite
return one_plus< sequence< zero_plus< alternatives< identifier, exactly<'-'> > >,
return sequence< one_plus< sequence< zero_plus< alternatives< identifier, exactly<'-'> > >,
interpolant,
zero_plus< alternatives< identifier, number, exactly<'-'> > > > >(src);
zero_plus< alternatives< identifier, number, exactly<'-'> > > > >,
negate< exactly<'%'> > >(src);
}
const char* value_schema(const char* src) {
// follows this pattern: ([xyz]*i[xyz]*)+
return one_plus< sequence< zero_plus< alternatives< identifier, percentage, dimension, hex, number, string_constant > >,
interpolant,
// #TODO: uncomment the 7th param whrn #745 is fixed
zero_plus< alternatives< identifier, percentage, dimension, hex, number, string_constant/*, exactly<'%'>*/ > > > >(src);
zero_plus< alternatives< identifier, percentage, dimension, hex, number, string_constant, exactly<'%'> > > > >(src);
}
const char* filename_schema(const char* src) {
return one_plus< sequence< zero_plus< alternatives< identifier, number, exactly<'.'>, exactly<'/'> > >,
Expand Down
20 changes: 10 additions & 10 deletions prelexer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,11 @@ namespace Sass {
prelexer mx5, prelexer mx6,
prelexer mx7>
const char* alternatives(const char* src) {
const char* rslt = src;
(rslt = mx1(rslt)) || (rslt = mx2(rslt)) ||
(rslt = mx3(rslt)) || (rslt = mx4(rslt)) ||
(rslt = mx5(rslt)) || (rslt = mx6(rslt)) ||
(rslt = mx7(rslt));
const char* rslt;
(rslt = mx1(src)) || (rslt = mx2(src)) ||
(rslt = mx3(src)) || (rslt = mx4(src)) ||
(rslt = mx5(src)) || (rslt = mx6(src)) ||
(rslt = mx7(src));
return rslt;
}

Expand All @@ -186,11 +186,11 @@ namespace Sass {
prelexer mx5, prelexer mx6,
prelexer mx7, prelexer mx8>
const char* alternatives(const char* src) {
const char* rslt = src;
(rslt = mx1(rslt)) || (rslt = mx2(rslt)) ||
(rslt = mx3(rslt)) || (rslt = mx4(rslt)) ||
(rslt = mx5(rslt)) || (rslt = mx6(rslt)) ||
(rslt = mx7(rslt)) || (rslt = mx8(rslt));
const char* rslt;
(rslt = mx1(src)) || (rslt = mx2(src)) ||
(rslt = mx3(src)) || (rslt = mx4(src)) ||
(rslt = mx5(src)) || (rslt = mx6(src)) ||
(rslt = mx7(src)) || (rslt = mx8(src));
return rslt;
}

Expand Down

0 comments on commit 86f56b2

Please sign in to comment.