mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 08:07:34 +00:00
LibJS: Handle hex and unicode escape sequences in string literals
Introduces the following syntax: '\x55' '\u26a0' '\u{1f41e}'
This commit is contained in:
parent
b3090678a9
commit
e415dd4e9c
5 changed files with 118 additions and 9 deletions
|
@ -172,9 +172,16 @@ public:
|
|||
size_t line_number() const { return m_line_number; }
|
||||
size_t line_column() const { return m_line_column; }
|
||||
double double_value() const;
|
||||
String string_value() const;
|
||||
bool bool_value() const;
|
||||
|
||||
enum class StringValueStatus {
|
||||
Ok,
|
||||
MalformedHexEscape,
|
||||
MalformedUnicodeEscape,
|
||||
UnicodeEscapeOverflow,
|
||||
};
|
||||
String string_value(StringValueStatus& status) const;
|
||||
|
||||
bool is_identifier_name() const;
|
||||
|
||||
private:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue