From a7b480ccbb4834e59858f5ffd04ab485da1e4b94 Mon Sep 17 00:00:00 2001 From: Kian Meng Ang Date: Mon, 18 Oct 2021 21:16:35 +0800 Subject: Fix typos (#443) * Fix typos * Revert changes in vendor module --- examples/c_files/memmgr.h | 2 +- examples/c_files/year.c | 4 ++-- pycparser/c_generator.py | 12 ++++++------ pycparser/c_lexer.py | 4 ++-- pycparser/c_parser.py | 4 ++-- pycparser/plyparser.py | 4 ++-- tests/c_files/memmgr.h | 2 +- tests/c_files/year.c | 4 ++-- tests/test_c_parser.py | 4 ++-- utils/internal/zc.c | 2 +- 10 files changed, 21 insertions(+), 21 deletions(-) diff --git a/examples/c_files/memmgr.h b/examples/c_files/memmgr.h index e792fb8..832614f 100644 --- a/examples/c_files/memmgr.h +++ b/examples/c_files/memmgr.h @@ -49,7 +49,7 @@ // minimize pool fragmentation in case of multiple allocations // and deallocations, it is advisable to not allocate // blocks that are too small. -// This flag sets the minimal ammount of quantas for +// This flag sets the minimal amount of quantas for // an allocation. If the size of a ulong is 4 and you // set this flag to 16, the minimal size of an allocation // will be 4 * 2 * 16 = 128 bytes diff --git a/examples/c_files/year.c b/examples/c_files/year.c index 12c4a33..f7c0920 100644 --- a/examples/c_files/year.c +++ b/examples/c_files/year.c @@ -7,8 +7,8 @@ void convert(int thousands, int hundreds, int tens, int ones) char *num[] = {"", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine"}; -char *for_ten[] = {"", "", "Twenty", "Thirty", "Fourty", "Fifty", "Sixty", - "Seventy", "Eighty", "Ninty"}; +char *for_ten[] = {"", "", "Twenty", "Thirty", "Forty", "Fifty", "Sixty", + "Seventy", "Eighty", "Ninety"}; char *af_ten[] = {"Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Ninteen"}; diff --git a/pycparser/c_generator.py b/pycparser/c_generator.py index bbf1dd1..1057b2c 100644 --- a/pycparser/c_generator.py +++ b/pycparser/c_generator.py @@ -97,11 +97,11 @@ class CGenerator(object): # # If `n.left.op` has a stronger or equally binding precedence in # comparison to `n.op`, no parenthesis are needed for the left: - # e.g., `(a*b) + c` is equivelent to `a*b + c`, as well as - # `(a+b) - c` is equivelent to `a+b - c` (same precedence). + # e.g., `(a*b) + c` is equivalent to `a*b + c`, as well as + # `(a+b) - c` is equivalent to `a+b - c` (same precedence). # If the left operator is weaker binding than the current, then # parentheses are necessary: - # e.g., `(a+b) * c` is NOT equivelent to `a+b * c`. + # e.g., `(a+b) * c` is NOT equivalent to `a+b * c`. lval_str = self._parenthesize_if( n.left, lambda d: not (self._is_simple_node(d) or @@ -109,11 +109,11 @@ class CGenerator(object): self.precedence_map[d.op] >= self.precedence_map[n.op])) # If `n.right.op` has a stronger -but not equal- binding precedence, # parenthesis can be omitted on the right: - # e.g., `a + (b*c)` is equivelent to `a + b*c`. + # e.g., `a + (b*c)` is equivalent to `a + b*c`. # If the right operator is weaker or equally binding, then parentheses # are necessary: - # e.g., `a * (b+c)` is NOT equivelent to `a * b+c` and - # `a - (b+c)` is NOT equivelent to `a - b+c` (same precedence). + # e.g., `a * (b+c)` is NOT equivalent to `a * b+c` and + # `a - (b+c)` is NOT equivalent to `a - b+c` (same precedence). rval_str = self._parenthesize_if( n.right, lambda d: not (self._is_simple_node(d) or diff --git a/pycparser/c_lexer.py b/pycparser/c_lexer.py index 2990170..d68d8eb 100644 --- a/pycparser/c_lexer.py +++ b/pycparser/c_lexer.py @@ -170,7 +170,7 @@ class CLexer(object): # Conditional operator (?) 'CONDOP', - # Delimeters + # Delimiters 'LPAREN', 'RPAREN', # ( ) 'LBRACKET', 'RBRACKET', # [ ] 'LBRACE', 'RBRACE', # { } @@ -414,7 +414,7 @@ class CLexer(object): # ? t_CONDOP = r'\?' - # Delimeters + # Delimiters t_LPAREN = r'\(' t_RPAREN = r'\)' t_LBRACKET = r'\[' diff --git a/pycparser/c_parser.py b/pycparser/c_parser.py index b1efac1..640a759 100644 --- a/pycparser/c_parser.py +++ b/pycparser/c_parser.py @@ -529,7 +529,7 @@ class CParser(PLYParser): # Declarations always come as lists (because they can be # several in one line), so we wrap the function definition # into a list as well, to make the return value of - # external_declaration homogenous. + # external_declaration homogeneous. def p_external_declaration_1(self, p): """ external_declaration : function_definition """ @@ -786,7 +786,7 @@ class CParser(PLYParser): """ p[0] = self._add_declaration_specifier(p[2], p[1], 'function') - # Withot this, `typedef _Atomic(T) U` will parse incorrectly because the + # Without this, `typedef _Atomic(T) U` will parse incorrectly because the # _Atomic qualifier will match, instead of the specifier. def p_declaration_specifiers_no_type_4(self, p): """ declaration_specifiers_no_type : atomic_specifier declaration_specifiers_no_type_opt diff --git a/pycparser/plyparser.py b/pycparser/plyparser.py index 6222c0e..b8f4c43 100644 --- a/pycparser/plyparser.py +++ b/pycparser/plyparser.py @@ -1,7 +1,7 @@ #----------------------------------------------------------------- # plyparser.py # -# PLYParser class and other utilites for simplifying programming +# PLYParser class and other utilities for simplifying programming # parsers with PLY # # Eli Bendersky [https://eli.thegreenplace.net/] @@ -53,7 +53,7 @@ class PLYParser(object): column=column) def _token_coord(self, p, token_idx): - """ Returns the coordinates for the YaccProduction objet 'p' indexed + """ Returns the coordinates for the YaccProduction object 'p' indexed with 'token_idx'. The coordinate includes the 'lineno' and 'column'. Both follow the lex semantic, starting from 1. """ diff --git a/tests/c_files/memmgr.h b/tests/c_files/memmgr.h index ae8212d..8eee907 100644 --- a/tests/c_files/memmgr.h +++ b/tests/c_files/memmgr.h @@ -49,7 +49,7 @@ // minimize pool fragmentation in case of multiple allocations // and deallocations, it is advisable to not allocate // blocks that are too small. -// This flag sets the minimal ammount of quantas for +// This flag sets the minimal amount of quantas for // an allocation. If the size of a ulong is 4 and you // set this flag to 16, the minimal size of an allocation // will be 4 * 2 * 16 = 128 bytes diff --git a/tests/c_files/year.c b/tests/c_files/year.c index 11d9475..eb33c1f 100644 --- a/tests/c_files/year.c +++ b/tests/c_files/year.c @@ -12,8 +12,8 @@ void convert(int thousands, int hundreds, int tens, int ones) char *num[] = {"", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine"}; -char *for_ten[] = {"", "", "Twenty", "Thirty", "Fourty", "Fifty", "Sixty", - "Seventy", "Eighty", "Ninty"}; +char *for_ten[] = {"", "", "Twenty", "Thirty", "Forty", "Fifty", "Sixty", + "Seventy", "Eighty", "Ninety"}; char *af_ten[] = {"Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Ninteen"}; diff --git a/tests/test_c_parser.py b/tests/test_c_parser.py index 33f3f07..4a5c90b 100755 --- a/tests/test_c_parser.py +++ b/tests/test_c_parser.py @@ -177,7 +177,7 @@ class TestCParser_fundamentals(TestCParser_base): def test_coords(self): """ Tests the "coordinates" of parsed elements - file name, line and column numbers, with modification - insterted by #line directives. + inserted by #line directives. """ self.assert_coord(self.parse('int a;').ext[0], 1, 5) @@ -1169,7 +1169,7 @@ class TestCParser_fundamentals(TestCParser_base): ['TypeDecl', ['IdentifierType', ['float']]]]]]]]) - # ISO/IEC 9899:201x Commitee Draft 2010-11-16, N1539 + # ISO/IEC 9899:201x Committee Draft 2010-11-16, N1539 # section 6.7.2.1, par. 19, example 1 s3 = """ struct v { diff --git a/utils/internal/zc.c b/utils/internal/zc.c index 5e56974..4c1c047 100644 --- a/utils/internal/zc.c +++ b/utils/internal/zc.c @@ -12,7 +12,7 @@ void print_help(int exval); int main (int argc, char *argv[]) { - /* word delimeter for strtok() */ + /* word delimiter for strtok() */ char delim[] = ".,:;`/\"+-_(){}[]<>*&^%$#@!?~/|\\=1234567890 \t\n"; char line[MAXLINE]; /* input buff, fgets() */ char *stray = NULL; /* returned value by strtok() */ -- cgit v1.2.1