Skip to content

Commit e6a34cf

Browse files
committed
Fix typos
After finding the "if if" typo, some additional typos identified by running `codespell` are also being corrected: https://github.com/codespell-project/codespell
1 parent dc6e7f5 commit e6a34cf

File tree

7 files changed

+18
-18
lines changed

7 files changed

+18
-18
lines changed

docs/cruby_compilation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ruby/ruby uses the Prism code to generate an AST from which it can generate inst
1010

1111
1. Compute an AST
1212

13-
Syncing over the Prism code allows ruby/ruby to compute the AST using Prism. It currently does this within [`iseq.c`](https://github.com/ruby/ruby/blob/master/iseq.c) using the `pm_parser_init` fuction.
13+
Syncing over the Prism code allows ruby/ruby to compute the AST using Prism. It currently does this within [`iseq.c`](https://github.com/ruby/ruby/blob/master/iseq.c) using the `pm_parser_init` function.
1414

1515
2. Run a first pass of compilation
1616

docs/serialization.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,14 +214,14 @@ Command line flags are a bitset. By default every flag is `0`. It includes the f
214214

215215
Scopes are ordered from the outermost scope to the innermost one.
216216

217-
Each scope is layed out as follows:
217+
Each scope is laid out as follows:
218218

219219
| # bytes | field |
220220
| ------- | -------------------------- |
221221
| `4` | the number of locals |
222222
| ... | the locals |
223223

224-
Each local is layed out as follows:
224+
Each local is laid out as follows:
225225

226226
| # bytes | field |
227227
| ------- | -------------------------- |

ext/prism/extension.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ parse_input(pm_string_t *input, const pm_options_t *options) {
730730
* parsed. This should be an array of arrays of symbols or nil. Scopes are
731731
* ordered from the outermost scope to the innermost one.
732732
* * `version` - the version of Ruby syntax that prism should used to parse Ruby
733-
* code. By default prism assumes you want to parse with the latest vesion
733+
* code. By default prism assumes you want to parse with the latest version
734734
* of Ruby syntax (which you can trigger with `nil` or `"latest"`). You
735735
* may also restrict the syntax to a specific version of Ruby. The
736736
* supported values are `"3.3.0"` and `"3.4.0"`.

include/prism/defines.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,31 +151,31 @@
151151
#else
152152
#ifndef xmalloc
153153
/**
154-
* The malloc function that should be used. This can be overriden with
154+
* The malloc function that should be used. This can be overridden with
155155
* the PRISM_XALLOCATOR define.
156156
*/
157157
#define xmalloc malloc
158158
#endif
159159

160160
#ifndef xrealloc
161161
/**
162-
* The realloc function that should be used. This can be overriden with
162+
* The realloc function that should be used. This can be overridden with
163163
* the PRISM_XALLOCATOR define.
164164
*/
165165
#define xrealloc realloc
166166
#endif
167167

168168
#ifndef xcalloc
169169
/**
170-
* The calloc function that should be used. This can be overriden with
170+
* The calloc function that should be used. This can be overridden with
171171
* the PRISM_XALLOCATOR define.
172172
*/
173173
#define xcalloc calloc
174174
#endif
175175

176176
#ifndef xfree
177177
/**
178-
* The free function that should be used. This can be overriden with the
178+
* The free function that should be used. This can be overridden with the
179179
* PRISM_XALLOCATOR define.
180180
*/
181181
#define xfree free

include/prism/options.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,14 +286,14 @@ PRISM_EXPORTED_FUNCTION void pm_options_free(pm_options_t *options);
286286
* | `0` | use the latest version of prism |
287287
* | `1` | use the version of prism that is vendored in CRuby 3.3.0 |
288288
*
289-
* Each scope is layed out as follows:
289+
* Each scope is laid out as follows:
290290
*
291291
* | # bytes | field |
292292
* | ------- | -------------------------- |
293293
* | `4` | the number of locals |
294294
* | ... | the locals |
295295
*
296-
* Each local is layed out as follows:
296+
* Each local is laid out as follows:
297297
*
298298
* | # bytes | field |
299299
* | ------- | -------------------------- |

src/prism.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5602,7 +5602,7 @@ pm_rescue_modifier_node_create(pm_parser_t *parser, pm_node_t *expression, const
56025602
}
56035603

56045604
/**
5605-
* Allocate and initiliaze a new RescueNode node.
5605+
* Allocate and initialize a new RescueNode node.
56065606
*/
56075607
static pm_rescue_node_t *
56085608
pm_rescue_node_create(pm_parser_t *parser, const pm_token_t *keyword) {
@@ -10416,7 +10416,7 @@ parser_lex(pm_parser_t *parser) {
1041610416
}
1041710417
default:
1041810418
// If we get to this point, then we have a % that is completely
10419-
// unparseable. In this case we'll just drop it from the parser
10419+
// unparsable. In this case we'll just drop it from the parser
1042010420
// and skip past it and hope that the next token is something
1042110421
// that we can parse.
1042210422
pm_parser_err_current(parser, PM_ERR_INVALID_PERCENT);
@@ -14426,7 +14426,7 @@ parse_heredoc_dedent_string(pm_string_t *string, size_t common_whitespace) {
1442614426
static void
1442714427
parse_heredoc_dedent(pm_parser_t *parser, pm_node_list_t *nodes, size_t common_whitespace) {
1442814428
// The next node should be dedented if it's the first node in the list or if
14429-
// if follows a string node.
14429+
// it follows a string node.
1443014430
bool dedent_next = true;
1443114431

1443214432
// Iterate over all nodes, and trim whitespace accordingly. We're going to
@@ -17949,7 +17949,7 @@ parse_regular_expression_named_captures(pm_parser_t *parser, const pm_string_t *
1794917949

1795017950
if (pm_regexp_named_capture_group_names(pm_string_source(content), pm_string_length(content), &named_captures, parser->encoding_changed, parser->encoding) && (named_captures.length > 0)) {
1795117951
// Since we should not create a MatchWriteNode when all capture names
17952-
// are invalid, creating a MatchWriteNode is delayed here.
17952+
// are invalid, creating a MatchWriteNode is delaid here.
1795317953
pm_match_write_node_t *match = NULL;
1795417954
pm_constant_id_list_t names = { 0 };
1795517955

@@ -19616,7 +19616,7 @@ pm_parser_errors_format(const pm_parser_t *parser, pm_buffer_t *buffer, bool col
1961619616

1961719617
// Now we're going to determine how we're going to format line numbers and
1961819618
// blank lines based on the maximum number of digits in the line numbers
19619-
// that are going to be displayed.
19619+
// that are going to be displaid.
1962019620
pm_error_format_t error_format;
1962119621
int32_t max_line_number = errors[error_list->size - 1].line - start_line;
1962219622

@@ -19707,7 +19707,7 @@ pm_parser_errors_format(const pm_parser_t *parser, pm_buffer_t *buffer, bool col
1970719707
pm_error_t *error = &errors[index];
1970819708

1970919709
// Here we determine how many lines of padding of the source to display,
19710-
// based on the difference from the last line that was displayed.
19710+
// based on the difference from the last line that was displaid.
1971119711
if (error->line - last_line > 1) {
1971219712
if (error->line - last_line > 2) {
1971319713
if ((index != 0) && (error->line - last_line > 3)) {
@@ -19739,7 +19739,7 @@ pm_parser_errors_format(const pm_parser_t *parser, pm_buffer_t *buffer, bool col
1973919739
// the width of the error, then the error message itself.
1974019740
//
1974119741
// Note that this doesn't take into account the width of the actual
19742-
// character when displayed in the terminal. For some east-asian
19742+
// character when displaid in the terminal. For some east-asian
1974319743
// languages or emoji, this means it can be thrown off pretty badly. We
1974419744
// will need to solve this eventually.
1974519745
pm_buffer_append_string(buffer, " ", 2);

test/prism/parse_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def test_parse_file_comments
204204
# Additionally, Ripper cannot parse the %w[] fixture in this file, so set ripper_should_parse to false.
205205
ripper_should_parse = false if relative == "spanning_heredoc.txt"
206206

207-
# Ruby < 3.3.0 cannot parse heredocs where there are leading whitespace charactes in the heredoc start.
207+
# Ruby < 3.3.0 cannot parse heredocs where there are leading whitespace characters in the heredoc start.
208208
# Example: <<~' EOF' or <<-' EOF'
209209
# https://bugs.ruby-lang.org/issues/19539
210210
ripper_should_parse = false if relative == "heredocs_leading_whitespace.txt" && RUBY_VERSION < "3.3.0"

0 commit comments

Comments
 (0)