Skip to content

Commit 7848fce

Browse files
committed
Shared: sync AccessPathSyntax.qll
1 parent d7f0716 commit 7848fce

File tree

3 files changed

+3
-12
lines changed

3 files changed

+3
-12
lines changed

csharp/ql/lib/semmle/code/csharp/dataflow/internal/AccessPathSyntax.qll

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ class AccessPath extends string instanceof AccessPath::Range {
4747
result = count(int n | exists(getRawToken(this, n))) and
4848
not this.hasSyntaxError()
4949
}
50-
51-
/** Gets the `n`th-last token, with 0 being the last token. */
52-
AccessPathToken getLastToken(int n) { result = this.getToken(this.getNumToken() - 1 - n) }
5350
}
5451

5552
/**
@@ -72,7 +69,7 @@ class AccessPathToken extends string {
7269
string getArgumentList() { result = this.getPart(2) }
7370

7471
/** Gets the `n`th argument to this token, such as `x` or `y` from `Member[x,y]`. */
75-
string getArgument(int n) { result = this.getArgumentList().splitAt(",", n) }
72+
string getArgument(int n) { result = this.getArgumentList().splitAt(",", n).trim() }
7673

7774
/** Gets an argument to this token, such as `x` or `y` from `Member[x,y]`. */
7875
string getAnArgument() { result = this.getArgument(_) }

java/ql/lib/semmle/code/java/dataflow/internal/AccessPathSyntax.qll

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ class AccessPath extends string instanceof AccessPath::Range {
4747
result = count(int n | exists(getRawToken(this, n))) and
4848
not this.hasSyntaxError()
4949
}
50-
51-
/** Gets the `n`th-last token, with 0 being the last token. */
52-
AccessPathToken getLastToken(int n) { result = this.getToken(this.getNumToken() - 1 - n) }
5350
}
5451

5552
/**
@@ -72,7 +69,7 @@ class AccessPathToken extends string {
7269
string getArgumentList() { result = this.getPart(2) }
7370

7471
/** Gets the `n`th argument to this token, such as `x` or `y` from `Member[x,y]`. */
75-
string getArgument(int n) { result = this.getArgumentList().splitAt(",", n) }
72+
string getArgument(int n) { result = this.getArgumentList().splitAt(",", n).trim() }
7673

7774
/** Gets an argument to this token, such as `x` or `y` from `Member[x,y]`. */
7875
string getAnArgument() { result = this.getArgument(_) }

ruby/ql/lib/codeql/ruby/dataflow/internal/AccessPathSyntax.qll

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ class AccessPath extends string instanceof AccessPath::Range {
4747
result = count(int n | exists(getRawToken(this, n))) and
4848
not this.hasSyntaxError()
4949
}
50-
51-
/** Gets the `n`th-last token, with 0 being the last token. */
52-
AccessPathToken getLastToken(int n) { result = this.getToken(this.getNumToken() - 1 - n) }
5350
}
5451

5552
/**
@@ -72,7 +69,7 @@ class AccessPathToken extends string {
7269
string getArgumentList() { result = this.getPart(2) }
7370

7471
/** Gets the `n`th argument to this token, such as `x` or `y` from `Member[x,y]`. */
75-
string getArgument(int n) { result = this.getArgumentList().splitAt(",", n) }
72+
string getArgument(int n) { result = this.getArgumentList().splitAt(",", n).trim() }
7673

7774
/** Gets an argument to this token, such as `x` or `y` from `Member[x,y]`. */
7875
string getAnArgument() { result = this.getArgument(_) }

0 commit comments

Comments
 (0)