Repository navigation
feat(send-receive): add Send and Receive from_csv_token - #161
Merged
Merged
Conversation
Send.from_csv_token() and Receive.from_csv_token() read a send(...) or receive(...) CSV token and return the instruction, as Coil.from_csv_token() does for out(...). They use the parser read_csv runs on an AF cell, and raise the same CsvReadError or FieldError that read_csv raises for that cell. A token of the other class raises CsvReadError and names the method to use instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ssweber
force-pushed
the
feat/sr-from-csv
branch
from
November 20, 2026 00:45
6d3619c to
ea58b81
Compare
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.
Adds
Send.from_csv_token(token)andReceive.from_csv_token(token), which Sam approved. Each reads asend(...)orreceive(...)CSV token and returns the instruction, asCoil.from_csv_token()does forout(...). pyrung currently reaches into the internal CSV parser for this:csv.ast.AfCall,csv.token_parser.parse_af_tokenandsend_receive.parse_af_call. These two methods replace those imports.Behaviour
read_csvruns on an AF cell.CsvReadErrororFieldErrorthatread_csvraises for that cell, without the location.CsvReadError, which names the method to use instead.Tests
.csvand the decoded.bin.from_csv_tokenmatchesread_csvon the same AF cell, for the instruction it returns and for seven bad tokens: the same class, code and message.Known gap, queued separately
Send and Receive tokens silently drop the following.
read_csvbehaves the same way today. Coil and Copy refuse these, and a follow-up branch will refuse them for Send and Receive too.sucess=C2;Gate
make lint: passed.make docs-build: passed.make test: 18849 passed, 139 skipped.