-
Notifications
You must be signed in to change notification settings - Fork 0
Review src/common/regexp.cpp #216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
| { | ||
| char* l = Line; | ||
| while (start < end) | ||
|
|
@@ -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 | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. // tady bych asi mnel hodit chybu takovato sekvence neni definovanaRationale: Meaning is correct, but first-person narration is not suitable for a technical code comment. |
||
| if (*sour >= '1' && *sour <= '9') | ||
| { | ||
| int n = *sour - '0'; | ||
|
|
@@ -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 | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. // znak za '\\' nemuze byt brany jako zavorkaRationale: |
||
| } | ||
| } | ||
| } | ||
|
|
@@ -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. | ||
| */ | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) | ||
| { | ||
|
|
@@ -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. | ||
| */ | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) | ||
| { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// insensitiveRationale:
insensitivealone is not idiomatic here; branch is for case-insensitive handling.