summaryrefslogtreecommitdiff
path: root/src/strings/literal.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/strings/literal.py')
-rw-r--r--src/strings/literal.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/strings/literal.py b/src/strings/literal.py
new file mode 100644
index 0000000..5031ff9
--- /dev/null
+++ b/src/strings/literal.py
@@ -0,0 +1,23 @@
+class LString(object):
+ __slots__ = ('_value')
+ name = 'tmwa::strings::LString'
+ enabled = True
+
+ def __init__(self, value):
+ self._value = value
+
+ def to_string(self):
+ v = self._value
+ b = v['_b']['_ptr']
+ e = v['_e']['_ptr']
+ d = e - b
+ return b.lazy_string(length=d)
+
+ test_extra = '''
+ using tmwa::operator "" _s;
+ '''
+
+ tests = [
+ ('""_s', '""'),
+ ('"Hello, World!"_s', '"Hello, World!"'),
+ ]