diff options
| author | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2014-12-23 23:35:11 +0100 |
|---|---|---|
| committer | Andreas Stöckel <andreas@somweyr.de> | 2014-12-23 23:35:11 +0100 |
| commit | c32c2d53c34e80a2681442afa11540fdde404fdc (patch) | |
| tree | 6e83b823c11de16d953d2dc25e5ab02f043b643f /src/core/common/Variant.cpp | |
| parent | ad03d497658ecacbf05674e5c34c67eab894e070 (diff) | |
implemented new Magic type used for single-token unescaped strings that could be an identifier
Diffstat (limited to 'src/core/common/Variant.cpp')
| -rw-r--r-- | src/core/common/Variant.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/common/Variant.cpp b/src/core/common/Variant.cpp index 0e69038..bc55377 100644 --- a/src/core/common/Variant.cpp +++ b/src/core/common/Variant.cpp @@ -51,6 +51,7 @@ const char *Variant::getTypeName(Type type) case Type::DOUBLE: return "double"; case Type::STRING: + case Type::MAGIC: return "string"; case Type::ARRAY: return "array"; @@ -93,6 +94,7 @@ Variant::intType Variant::toInt() const case Type::DOUBLE: return asDouble(); case Type::STRING: + case Type::MAGIC: return 0; // TODO: Parse string as int case Type::ARRAY: { // JavaScript behaviour when converting arrays to ints @@ -117,6 +119,7 @@ Variant::doubleType Variant::toDouble() const case Type::DOUBLE: return asDouble(); case Type::STRING: + case Type::MAGIC: return 0.0; // TODO: Parse string as double case Type::ARRAY: { // JavaScript behaviour when converting array to doubles @@ -147,6 +150,7 @@ Variant::stringType Variant::toString(bool escape) const return ss.str(); } case Type::STRING: { + case Type::MAGIC: // TODO: Use proper serialization function if (escape) { std::stringstream ss; |
