diff options
author | Germán M. Bravo <german.mb@gmail.com> | 2016-10-18 07:33:50 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-18 07:33:50 -0500 |
commit | 7f4725baa9e64455b41befb45e3e48ba266b9252 (patch) | |
tree | ee30835948669ca14a0ce71b5b994f21d9052654 | |
parent | c28b5879cfaa9bb5d485e60e78a4d5f1ae803333 (diff) | |
parent | 4cf0cb606ad32a04774a0a3ca9186e238bf61c1f (diff) | |
download | pyscss-7f4725baa9e64455b41befb45e3e48ba266b9252.tar.gz |
Merge pull request #359 from natano/speedup_braces
Let the speedup block locator complain about surplus closing braces.
-rw-r--r-- | scss/src/block_locator.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/scss/src/block_locator.c b/scss/src/block_locator.c index 193b62c..8e634a4 100644 --- a/scss/src/block_locator.c +++ b/scss/src/block_locator.c @@ -398,6 +398,12 @@ BlockLocator_iternext(BlockLocator *self) if (c == '\\') { /* Start of an escape sequence; ignore next character */ self->codestr_ptr++; + } else if (c == '}' && self->depth == 0) { + self->block.error = -1; + sprintf(self->exc, "Unexpected closing brace on line %d", self->lineno); + #ifdef DEBUG + fprintf(stderr, "\t%s\n", self->exc); + #endif } /* only ASCII is special syntactically */ else if (c < 256) { |