Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/common/regexp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ BOOL CRegularExpression::SetLine(const char* start, const char* end)
memcpy(Line, start, LineLength);
Line[LineLength] = 0;
}
else // insensitive
else // case-insensitive
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// insensitive

Rationale: insensitive alone is not idiomatic here; branch is for case-insensitive handling.

{
char* l = Line;
while (start < end)
Expand Down Expand Up @@ -272,7 +272,7 @@ BOOL CRegularExpression::ExpandVariables(char* pattern, char* buffer, int bufSiz
{
sour++;
if (!*sour)
break; // I should probably throw an error here; such a sequence is not defined
break; // An error should probably be thrown here; such a sequence is not defined
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// tady bych asi mnel hodit chybu takovato sekvence neni definovana

Rationale: Meaning is correct, but first-person narration is not suitable for a technical code comment.

if (*sour >= '1' && *sour <= '9')
{
int n = *sour - '0';
Expand Down Expand Up @@ -405,7 +405,7 @@ void CRegularExpression::ReverseRegExp(char*& dstExpEnd, char* srcExp, char* src
{
if (*ss != 0)
ss++;
break; // the character after '\\' cannot be treated as a bracket
break; // the character after '\\' cannot be treated as a parenthesis
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// znak za '\\' nemuze byt brany jako zavorka

Rationale: bracket is too broad; code tracks parentheses and square brackets separately, here escaped char must not count as a parenthesis.

}
}
}
Expand Down Expand Up @@ -829,9 +829,9 @@ char* reg(int paren /* Parenthesized? */, int* flagp)
}

/*
- regbranch - one alternative of an | operator
- regbranch - one alternative of a | operator
*
* Implements the concatenation operator.
* Implements concatenation.
*/
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/*
- regbranch - one alternative of an | operator
*
* Implements the concatenation operator.
*/

Rationale: Article and phrasing are slightly unnatural; concise standard wording is better.

char* regbranch(int* flagp)
{
Expand Down Expand Up @@ -1086,9 +1086,9 @@ void regc(char b)
}

/*
- reginsert - insert an operator in front of already-emitted operand
- reginsert - insert an operator in front of an already-emitted operand
*
* Means relocating the operand.
* This means relocating the operand.
*/
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/*
- reginsert - insert an operator in front of already-emitted operand
*
* Means relocating the operand.
*/

Rationale: Missing article makes the current text ungrammatical.

void reginsert(char op, char* opnd)
{
Expand Down
Loading