Permalink
Browse files

Implement getValue. Curently broken.

  • Loading branch information...
1 parent 1592de8 commit b06bbeb9d6d287d7b2e6792c2c7dc1e4d37870a2 @Bigcheese committed Feb 7, 2012
Showing with 345 additions and 80 deletions.
  1. +10 −0 include/llvm/Support/YAMLParser.h
  2. +325 −79 lib/Support/YAMLParser.cpp
  3. +7 −0 test/YAMLParser/spec-02-17.data
  4. +3 −1 utils/yaml-bench/YAMLBench.cpp
@@ -67,6 +67,9 @@ bool dumpTokens(StringRef Input, raw_ostream &);
/// @returns true if there was an error, false otherwise.
bool scanTokens(StringRef Input);
+/// @brief Escape \a Input for a double quoted scalar.
+std::string escape(StringRef Input);
+
/// @brief This class represents a YAML stream potentially containing multiple
/// documents.
class Stream {
@@ -158,6 +161,13 @@ class ScalarNode : public Node {
// utf8).
StringRef getRawValue() const { return Value; }
+ /// @brief Gets the value of this node as a StringRef.
+ ///
+ /// @param Storage is used to store the content of the returned StringRef iff
+ /// it requires any modifcation from how it appeared in the source.
+ /// This happens with escaped characters and multi-line literals.
+ StringRef getValue(SmallVectorImpl<char> &Storage) const;
+
static inline bool classof(const ScalarNode *) { return true; }
static inline bool classof(const Node *N) {
return N->getType() == NK_Scalar;
Oops, something went wrong.

0 comments on commit b06bbeb

Please sign in to comment.