mirror of
https://github.com/piotr-wiszowaty/foco65.git
synced 2024-12-17 20:30:12 +00:00
Handle ASCII strings
This commit is contained in:
parent
259dc66d0e
commit
a19478a816
@ -149,7 +149,7 @@ Allocate Atari XL/XE Antic string:
|
|||||||
|
|
||||||
`'` _text_`'`
|
`'` _text_`'`
|
||||||
|
|
||||||
Allocate counted ASCII string:
|
Allocate ASCII string:
|
||||||
|
|
||||||
`"` _text_`"`
|
`"` _text_`"`
|
||||||
|
|
||||||
|
10
foco65
10
foco65
@ -563,15 +563,19 @@ class Forth:
|
|||||||
item = Code("\n dta %d" % self.pop(token), self.data_section)
|
item = Code("\n dta %d" % self.pop(token), self.data_section)
|
||||||
self.items.append(item)
|
self.items.append(item)
|
||||||
|
|
||||||
def parse_comma_doublequote(self):
|
def parse_comma_doublequote(self, counted):
|
||||||
# allocate ASCII counted string
|
# allocate ASCII string
|
||||||
self.input.mark_start()
|
self.input.mark_start()
|
||||||
while True:
|
while True:
|
||||||
token = self.next()
|
token = self.next()
|
||||||
if token.endswith('"'):
|
if token.endswith('"'):
|
||||||
self.input.mark_end()
|
self.input.mark_end()
|
||||||
text = self.input.marked()[1:-1]
|
text = self.input.marked()[1:-1]
|
||||||
item = Code("\n dta %d,c'%s'" % (len(text), text), self.data_section)
|
if counted:
|
||||||
|
count = "%d," % len(text)
|
||||||
|
else:
|
||||||
|
count = ""
|
||||||
|
item = Code("\n dta %sc'%s'" % (count, text), self.data_section)
|
||||||
self.items.append(item)
|
self.items.append(item)
|
||||||
break
|
break
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user