Ruby: fix spelling errors

This commit is contained in:
Nick Rolfe
2022-05-25 16:38:48 +01:00
parent 0b6e35a2a9
commit 385e442f7f
5 changed files with 7 additions and 7 deletions

View File

@@ -109,7 +109,7 @@ class NamedParameter extends Parameter, TNamedParameter {
final VariableAccess getDefiningAccess() {
result = this.getVariable().getDefiningAccess()
or
result = this.(SimpleParameterSynthImpl).getDefininingAccess()
result = this.(SimpleParameterSynthImpl).getDefiningAccess()
}
override AstNode getAChild(string pred) {

View File

@@ -116,7 +116,7 @@ class VariableAccess extends Expr instanceof VariableAccessImpl {
predicate isImplicitWrite() {
implicitWriteAccess(toGenerated(this))
or
this = any(SimpleParameterSynthImpl p).getDefininingAccess()
this = any(SimpleParameterSynthImpl p).getDefiningAccess()
or
this = any(HashPattern p).getValue(_)
or

View File

@@ -38,7 +38,7 @@ class SimpleParameterRealImpl extends SimpleParameterImpl, TSimpleParameterReal
class SimpleParameterSynthImpl extends SimpleParameterImpl, TSimpleParameterSynth {
SimpleParameterSynthImpl() { this = TSimpleParameterSynth(_, _) }
LocalVariableAccessSynth getDefininingAccess() { synthChild(this, 0, result) }
LocalVariableAccessSynth getDefiningAccess() { synthChild(this, 0, result) }
override LocalVariable getVariableImpl() { result = TLocalVariableSynth(this, _) }

View File

@@ -44,7 +44,7 @@ replace further instances of the string that result from earlier replacements.
</p>
<p>
For example, consider the code snippet <code>s.gsub /\/\.\.\//, ""</code>, which attempts to strip
out all occurences of <code>/../</code> from <code>s</code>. This will not work as expected: for the
out all occurrences of <code>/../</code> from <code>s</code>. This will not work as expected: for the
string <code>/./.././</code>, for example, it will remove the single occurrence of <code>/../</code>
in the middle, but the remainder of the string then becomes <code>/../</code>, which is another
instance of the substring we were trying to remove.

View File

@@ -116,7 +116,7 @@ predicate allBackslashesEscaped(DataFlow::Node node) {
* Holds if `sub` looks like a string substitution call that deliberately
* removes the first occurrence of `str`.
*/
predicate removesFirstOccurence(StringSubstitutionCall sub, string str) {
predicate removesFirstOccurrence(StringSubstitutionCall sub, string str) {
not sub.isGlobal() and sub.replaces(str, "")
}
@@ -158,8 +158,8 @@ predicate isDelimiterUnwrapper(StringSubstitutionCall leftUnwrap, StringSubstitu
or
left = "'" and right = "'"
|
removesFirstOccurence(leftUnwrap, left) and
removesFirstOccurence(rightUnwrap, right) and
removesFirstOccurrence(leftUnwrap, left) and
removesFirstOccurrence(rightUnwrap, right) and
rightUnwrap = getAMethodCall(leftUnwrap)
)
}