Skip to content

Commit cfbfd70

Browse files
committed
Fix a few typos in the parser's comments
1 parent 01e0d84 commit cfbfd70

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

src/parser.cpp

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ namespace Sass {
615615
while (peek_css< exactly<','> >())
616616
{
617617
lex< css_comments >(false);
618-
// consume everything up and including the comma speparator
618+
// consume everything up and including the comma separator
619619
reloop = lex< exactly<','> >() != 0;
620620
// remember line break (also between some commas)
621621
had_linefeed = had_linefeed || peek_newline();
@@ -719,7 +719,7 @@ namespace Sass {
719719
// EO parse_complex_selector
720720

721721
// parse one compound selector, which is basically
722-
// a list of simple selectors (directly adjancent)
722+
// a list of simple selectors (directly adjacent)
723723
// lex them exactly (without skipping white-space)
724724
Compound_Selector* Parser::parse_compound_selector()
725725
{
@@ -747,7 +747,7 @@ namespace Sass {
747747
seq->has_parent_reference(true);
748748
(*seq) << SASS_MEMORY_NEW(ctx.mem, Parent_Selector, pstate);
749749
// parent selector only allowed at start
750-
// upcoming sass may allow also trailing
750+
// upcoming Sass may allow also trailing
751751
if (seq->length() > 1) {
752752
ParserState state(pstate);
753753
Simple_Selector* cur = (*seq)[seq->length()-1];
@@ -834,7 +834,7 @@ namespace Sass {
834834
}
835835

836836
// a pseudo selector often starts with one or two colons
837-
// it can contain more selectors inside parantheses
837+
// it can contain more selectors inside parentheses
838838
Simple_Selector* Parser::parse_pseudo_selector() {
839839
if (lex< sequence<
840840
optional < pseudo_prefix >,
@@ -1213,9 +1213,9 @@ namespace Sass {
12131213
: lex<kwd_lte>() ? Sass_OP::LTE
12141214
: lex<kwd_gt>() ? Sass_OP::GT
12151215
: lex<kwd_lt>() ? Sass_OP::LT
1216-
// we checked the possibilites on top of fn
1216+
// we checked the possibilities on top of fn
12171217
: Sass_OP::EQ;
1218-
// is directly adjancent to expression?
1218+
// is directly adjacent to expression?
12191219
bool right_ws = peek < css_comments >() != NULL;
12201220
operators.push_back({ op, left_ws, right_ws });
12211221
operands.push_back(parse_expression());
@@ -1238,7 +1238,6 @@ namespace Sass {
12381238
// NOTE: dashes do NOT count as subtract operation
12391239
Expression* lhs = parse_operators();
12401240
// if it's a singleton, return it (don't wrap it)
1241-
// if it's a singleton, return it (don't wrap it)
12421241
if (!(peek_css< exactly<'+'> >(position) ||
12431242
// condition is a bit misterious, but some combinations should not be counted as operations
12441243
(peek< no_spaces >(position) && peek< sequence< negate< unsigned_number >, exactly<'-'>, negate< space > > >(position)) ||
@@ -1308,7 +1307,6 @@ namespace Sass {
13081307
if (!lex_css< exactly<')'> >()) error("unclosed parenthesis", pstate);
13091308
// expression can be evaluated
13101309
// make sure wrapped lists and division expressions are non-delayed within parentheses
1311-
// make sure wrapped lists and division expressions are non-delayed within parentheses
13121310
if (value->concrete_type() == Expression::LIST) {
13131311
// List* l = static_cast<List*>(value);
13141312
// if (!l->empty()) (*l)[0]->is_delayed(false);
@@ -1416,7 +1414,7 @@ namespace Sass {
14161414
if (lex< percentage >())
14171415
{ return SASS_MEMORY_NEW(ctx.mem, Textual, pstate, Textual::PERCENTAGE, lexed); }
14181416

1419-
// match hex number first because 0x000 looks like a number followed by an indentifier
1417+
// match hex number first because 0x000 looks like a number followed by an identifier
14201418
if (lex< sequence < alternatives< hex, hex0 >, negate < exactly<'-'> > > >())
14211419
{ return SASS_MEMORY_NEW(ctx.mem, Textual, pstate, Textual::HEX, lexed); }
14221420

@@ -1630,7 +1628,7 @@ namespace Sass {
16301628
lex < exactly < rbrace > >();
16311629
}
16321630
// lex some string constants or other valid token
1633-
// Note: [-+] chars are left over from ie. `#{3}+3`
1631+
// Note: [-+] chars are left over from i.e. `#{3}+3`
16341632
else if (lex< alternatives < exactly<'%'>, exactly < '-' >, exactly < '+' > > >()) {
16351633
(*schema) << SASS_MEMORY_NEW(ctx.mem, String_Constant, pstate, lexed);
16361634
}
@@ -1899,7 +1897,7 @@ namespace Sass {
18991897
if (!peek< exactly <'$'> >()) {
19001898
css_error("Invalid CSS", " after ", ": expected \"$\", was ");
19011899
}
1902-
// we expect a simple identfier as the call name
1900+
// we expect a simple identifier as the call name
19031901
if (!lex< sequence < exactly <'$'>, identifier > >()) {
19041902
lex< exactly <'$'> >(); // move pstate and position up
19051903
css_error("Invalid CSS", " after ", ": expected identifier, was ");
@@ -1910,7 +1908,7 @@ namespace Sass {
19101908
// helper to parse identifier
19111909
Token Parser::lex_identifier()
19121910
{
1913-
// we expect a simple identfier as the call name
1911+
// we expect a simple identifier as the call name
19141912
if (!lex< identifier >()) { // ToDo: pstate wrong?
19151913
css_error("Invalid CSS", " after ", ": expected identifier, was ");
19161914
}
@@ -2097,7 +2095,7 @@ namespace Sass {
20972095
}
20982096

20992097
// TODO: This needs some major work. Although feature conditions
2100-
// look like declarations their semantics differ siginificantly
2098+
// look like declarations their semantics differ significantly
21012099
Supports_Condition* Parser::parse_supports_declaration()
21022100
{
21032101
Supports_Condition* cond = 0;
@@ -2264,7 +2262,7 @@ namespace Sass {
22642262
if (const char* q =
22652263
peek <
22662264
alternatives <
2267-
// partial bem selector
2265+
// partial BEM selector
22682266
sequence <
22692267
ampersand,
22702268
one_plus <
@@ -2305,7 +2303,7 @@ namespace Sass {
23052303
// single or double colon
23062304
optional < pseudo_prefix >
23072305
>,
2308-
// accept hypens in token
2306+
// accept hyphens in token
23092307
one_plus < sequence <
23102308
// can start with hyphens
23112309
zero_plus < exactly<'-'> >,
@@ -2429,7 +2427,7 @@ namespace Sass {
24292427
// ToDo: remove
24302428
rv.position = q;
24312429
// check expected opening bracket
2432-
// only after successfull matching
2430+
// only after successful matching
24332431
if (peek < exactly<'{'> >(q)) rv.found = q;
24342432
else if (peek < exactly<';'> >(q)) rv.found = q;
24352433
else if (peek < exactly<'}'> >(q)) rv.found = q;

0 commit comments

Comments
 (0)