summaryrefslogtreecommitdiffstats
path: root/mlir/lib/Parser/Token.cpp
diff options
context:
space:
mode:
authorJames Molloy <jmolloy@google.com>2018-08-14 01:16:45 -0700
committerjpienaar <jpienaar@google.com>2019-03-29 12:59:32 -0700
commitab60afb234704165a622b57e9ba0476d8d533074 (patch)
treed631314c9ee947a164fd810526c4a77f09819502 /mlir/lib/Parser/Token.cpp
parent3e92be9c71fbaeb759e32aa3aed3d4812e4db035 (diff)
downloadbcm5719-llvm-ab60afb234704165a622b57e9ba0476d8d533074.tar.gz
bcm5719-llvm-ab60afb234704165a622b57e9ba0476d8d533074.zip
[mlir] Allow C-style escapes in Lexer
This patch passes the raw, unescaped value through to the rest of the stack. Partial escaping is a total pain to deal with, so we either need to implement escaping properly (ideally using a third party library like absl, I don't think LLVM has one that can handle the proper gamut of escape codes) or don't escape. I chose the latter for this patch. PiperOrigin-RevId: 208608945
Diffstat (limited to 'mlir/lib/Parser/Token.cpp')
-rw-r--r--mlir/lib/Parser/Token.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/mlir/lib/Parser/Token.cpp b/mlir/lib/Parser/Token.cpp
index 9fc2b2f40d1..2bce68153c2 100644
--- a/mlir/lib/Parser/Token.cpp
+++ b/mlir/lib/Parser/Token.cpp
@@ -81,9 +81,8 @@ Optional<unsigned> Token::getIntTypeBitwidth() const {
/// Given a 'string' token, return its value, including removing the quote
/// characters and unescaping the contents of the string.
std::string Token::getStringValue() const {
- // TODO: Handle escaping.
-
- // Just drop the quotes off for now.
+ // Start by dropping the quotes.
+ // TODO: Un-escape the string here instead of passing through the raw content.
return getSpelling().drop_front().drop_back().str();
}
OpenPOWER on IntegriCloud