Skip to content

Commit 72b109d

Browse files
committed
Fix typos and reword comments
1 parent 5cd41a1 commit 72b109d

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

doc/user/compatibility.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ A possible workaround could be to use natively-allocated strings, but it would b
123123

124124
### Strings in UTF-16 and UTF-32 encoding
125125

126-
TruffleRuby does not support UTF-16 strings with an odd number of bytes (in native endianness). Similarly, with UTF-32 it needs to be a multiple of 4.
126+
TruffleRuby does not support UTF-16 strings with an odd number of bytes (in native endianness). Similarly, with UTF-32 it needs to be a multiple of 4. This is necessary for optimizations, compression, invariants, etc.
127127

128128
### Threads detect interrupts at different points
129129

src/main/java/org/truffleruby/parser/YARPLoadArgumentsTranslator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,8 @@ private boolean hasRest() {
353353
* end
354354
* </pre>
355355
*
356-
* They should be forwarded properly but there are no local variables declared for such duplicated parameters.
357-
* That's why such local variables should be declared now. */
356+
* They should be forwarded properly but there are no local variables declared in Prism for such duplicated
357+
* parameters. That's why such local variables should be declared now. */
358358
private String createNameForRepeatedParameter(String name) {
359359
int count = repeatedParameterCounter++;
360360
return Layouts.TEMP_PREFIX + name + count;

src/main/java/org/truffleruby/parser/YARPReloadArgumentsTranslator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,8 @@ protected RubyNode defaultVisit(Nodes.Node node) {
241241
* end
242242
* </pre>
243243
*
244-
* They should be forwarded properly but there are no local variables declared for such duplicated parameters.
245-
* That's why such local variables should be declared now. */
244+
* They should be forwarded properly but there are no local variables declared in Prism for such duplicated
245+
* parameters. That's why such local variables should be declared now. */
246246
private String createNameForRepeatedParameter(String name) {
247247
int count = repeatedParameterCounter++;
248248
return Layouts.TEMP_PREFIX + name + count;

src/main/java/org/truffleruby/parser/YARPTranslator.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,8 @@ public class YARPTranslator extends YARPBaseTranslator {
177177
public Deque<Integer> frameOnStackMarkerSlotStack = new ArrayDeque<>();
178178
/** whether a while-loop body is translated; needed to check correctness of operators like break/next/etc */
179179
private boolean translatingWhile = false;
180-
/** whether a for-loop body is translated; needed to prevent creating a new lexical scope for body */
180+
/** whether a for-loop body is translated; needed to enforce variables in the for-loop body to be declared outside
181+
* the for-loop */
181182
private boolean translatingForStatement = false;
182183

183184
/** names of numbered parameters in procs */
@@ -1623,7 +1624,7 @@ public RubyNode visitEmbeddedVariableNode(Nodes.EmbeddedVariableNode node) {
16231624

16241625
@Override
16251626
public RubyNode visitEnsureNode(Nodes.EnsureNode node) {
1626-
// EnsureNode without statements should be handles in #visitBeginNode
1627+
// EnsureNode without statements should be handled in #visitBeginNode
16271628
assert node.statements != null;
16281629

16291630
return node.statements.accept(this);
@@ -2972,7 +2973,7 @@ private record RegexpEncodingAndOptions(RubyEncoding encoding, RegexpOptions opt
29722973

29732974
/** Return Regexp modifiers (e.g. m, i, x, ...) and encoding. Encoding is based on encoding modifiers (n, u, e, s)
29742975
* and could be inferred (forced) from Regexp source characters. If there are no encoding modifiers and encoding is
2975-
* not forced - a source file encoding is returned. */
2976+
* not forced - the source file encoding is returned. */
29762977
private RegexpEncodingAndOptions getRegexpEncodingAndOptions(Nodes.RegularExpressionFlags flags) {
29772978
RubyEncoding regexpEncoding;
29782979

@@ -3723,7 +3724,7 @@ private RubyNode translateWhileNode(Nodes.Node node, Nodes.Node predicate, Nodes
37233724
return rubyNode;
37243725
}
37253726

3726-
/** A node is side-effect-free if cannot connot access $! */
3727+
/** A node is side-effect-free if it cannot access $! */
37273728
protected boolean isSideEffectFreeRescueExpression(Nodes.Node node) {
37283729
return node instanceof Nodes.InstanceVariableReadNode ||
37293730
node instanceof Nodes.LocalVariableReadNode ||

0 commit comments

Comments
 (0)