docs(plan): double-quoted strings as sugar for [ '...' ]#37
Open
Hypercubed wants to merge 8 commits intomainfrom
Open
docs(plan): double-quoted strings as sugar for [ '...' ]#37Hypercubed wants to merge 8 commits intomainfrom
[ '...' ]#37Hypercubed wants to merge 8 commits intomainfrom
Conversation
Co-authored-by: Jayson Harshbarger <Hypercubed@users.noreply.github.com>
…e path Co-authored-by: Jayson Harshbarger <Hypercubed@users.noreply.github.com>
Double-quoted tokens use the same unescapeString pipeline and per-character pushes as single-quoted literals (no implicit 0). Add Deno compile tests and a TAP .ffp suite under ff/lib/string/__tests__. Co-authored-by: Jayson Harshbarger <Hypercubed@users.noreply.github.com>
Emit BRA, per-character pushes (same as single-quoted), then KET so "hi" is a quotation; eval matches bare 'hi'. Accept standalone [ and ] tokens so [ 'hi' ] tokenizes like the sugar form. Update Deno IR tests, TAP tests (seq= vs [ 'hi' ], eval vs chars), and plan implementation status. Co-authored-by: Jayson Harshbarger <Hypercubed@users.noreply.github.com>
Go: compile "..." as BRA + per-char pushes + KET; accept [ and ] tokens. Add compiler tests mirroring TS behavior. Racket: lex double-quoted strings (STR-DQ), standalone [ ] (BRA/KET); share ff-unescape with single-quoted strings. Extend brag grammar and compile/ runner/expander macros for STR-DQ and brackets. Update string plan implementation status. Co-authored-by: Jayson Harshbarger <Hypercubed@users.noreply.github.com>
Expand "..." at tokenize time to '[', Unicode code units as integers, and ']', matching other compilers' BRA/push/KET shape. - python/execute.py, ruby/execute.rb: tokenizer flat_map expansion - dart/bin/dart.dart: tokenize() same expansion Add small verification scripts (python test_double_quote_tokenize.py, ruby test_double_quote_stdout.rb, dart run tool/check_double_quote.dart). Update string plan implementation list. Co-authored-by: Jayson Harshbarger <Hypercubed@users.noreply.github.com>
…enizer Keep "..." as a single string token from tokenize(); prepend [ char-codes ] to the queue when run() processes it. Update plan doc and Python self-check. Co-authored-by: Jayson Harshbarger <Hypercubed@users.noreply.github.com>
Remove string expansion from tokenize(); handle "..." in ev() like Python/Ruby by prepending [ code-unit tokens ] to the queue. Update check script and plan doc. Co-authored-by: Jayson Harshbarger <Hypercubed@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Dart (updated)
tokenize(): whitespace-only split (RegExp(r'\s+')), no string rewriting.ev(): when a token is a double-quoted string ("..."), prepend['[', ...code unit strings..., ']']viapushFrontQueueAll(same model as Python/Rubyrun()).Check:
cd dart && dart run tool/check_double_quote.dartOther runtimes unchanged from prior PR commits (TS/Go/Racket compilers; Python/Ruby expand in
run()).