-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SubX in SubX: Transforming uses of string literals (prerequisite A) #26
Conversation
Converting literal strings into bytes in the data segment.
Operations on buffered-file now always include the word 'buffered'. More verbose, but hopefully this highlights holes in the library.
These are variants of write-byte-buffered and print-byte-buffered respectively that operate on in-memory `stream`s rather than `buffered-file`s. They don't operate on files, so we'll avoid using the prefix 'write-'.
Convert raw literal strings (no escape sequences) to the data segment.
Segfault in this branch is now fixed.
@charles-l The segfault in this branch should now be fixed. Can you confirm? |
dquotes.subx is now segfaulting after this merge. Seems to be trying to use addresses from the old stack.
How did things seem to be working until now? - We were saving an address from the stack to stream.read - When we read this address in skip-chars-matching:loop, we used to stop early But now we've moved the stack to a larger address, one where the most significant byte is set. When the stack address now gets to skip-chars-matching:loop, it's treated as a negative number and we proceed through the loop. At which point we try to index into the array using it. No real test to be written to protect against this :(
Still some failing tests: - emit-string-literal-data doesn't ignore metadata when computing the length of literal strings - emit-string-literal-data doesn't handle escape sequences One issue doesn't have a failing test: - emit-metadata doesn't handle string literals containing '/' All these open issues involve a common design question: how to parse a 'word' that includes a string literal that may include spaces. For everything else I know words can't contain spaces and datums can't contain slashes. But for string literals things are tougher.
I've gotten dquotes.subx to some sort of milestone and am going to merge the existing PRs. We have a design problem, and all these branches and PRs now seem like a hindrance. Let's get to a clean working state on The design problem is outlined in this commit message: 438e5a0 |
One of two primitives remaining to be built in dquotes.subx.
For more context, see the parent branch.