Skip to content

Commit

Permalink
Merge pull request #727 from xzyfer/feat/reserved-function-names
Browse files Browse the repository at this point in the history
Error if a user defined function uses a reserved name
  • Loading branch information
xzyfer committed Dec 12, 2014
2 parents cf54cd8 + 960037d commit 2e745ea
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ namespace Sass {
string which_str(lexed);
if (!lex< identifier >()) error("invalid name in " + which_str + " definition");
string name(Util::normalize_underscores(lexed));
if (which_type == Definition::FUNCTION && (name == "and" || name == "or" || name == "not"))
{ error("Invalid function name \"" + name + "\"."); }
Position source_position_of_def = source_position;
Parameters* params = parse_parameters();
if (!peek< exactly<'{'> >()) error("body for " + which_str + " " + name + " must begin with a '{'");
Expand Down

0 comments on commit 2e745ea

Please sign in to comment.