mirror of
https://github.com/github/codeql.git
synced 2026-04-28 02:05:14 +02:00
C#: Library support for string UTF8/UTF16 encodings.
This commit is contained in:
@@ -102,7 +102,8 @@ class DecimalLiteral extends RealLiteral, @decimal_literal_expr {
|
||||
}
|
||||
|
||||
/**
|
||||
* A `string` literal, for example `"Hello, World!"`.
|
||||
* A `string` literal. Either a `string` literal (`StringLiteralUtf16`),
|
||||
* or a `u8` literal (`StringLiteralUtf8`).
|
||||
*/
|
||||
class StringLiteral extends DotNet::StringLiteral, Literal, @string_literal_expr {
|
||||
override string toString() { result = "\"" + this.getValue().replaceAll("\"", "\\\"") + "\"" }
|
||||
@@ -110,6 +111,20 @@ class StringLiteral extends DotNet::StringLiteral, Literal, @string_literal_expr
|
||||
override string getAPrimaryQlClass() { result = "StringLiteral" }
|
||||
}
|
||||
|
||||
/**
|
||||
* A `string` literal, for example `"Hello, World!"`.
|
||||
*/
|
||||
class StringLiteralUtf16 extends StringLiteral, @utf16_string_literal_expr {
|
||||
override string getAPrimaryQlClass() { result = "StringLiteralUtf16" }
|
||||
}
|
||||
|
||||
/**
|
||||
* A `u8` literal, for example `"AUTH"u8`
|
||||
*/
|
||||
class StringLiteralUtf8 extends StringLiteral, @utf8_string_literal_expr {
|
||||
override string getAPrimaryQlClass() { result = "StringLiteralUtf8" }
|
||||
}
|
||||
|
||||
/**
|
||||
* A `null` literal.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user