-
Notifications
You must be signed in to change notification settings - Fork 38
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
sch2pcb: Rewrite the function pkg-line->element() in Scheme #1063
Merged
Conversation
This file contains 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
The module will contain procedures related to PcbElement processing. Currently it contains an only procedure, pkg-line->element().
This is a temporary function that will be used in Scheme code instead of the foreign function pcb_element_free().
…ht parens The tests contain either several right parens or a paren and some text after it. The current C code drops anything starting with the first right paren found.
The pointer argument of the pkg-line->element() function has been replaced with a Scheme string one to simplify using it in Scheme. The tests have been amended accordingly.
This is needed to re-use the found paren index in further computations.
Unlike in the previous C code, there is no restriction to the maximal number of arguments in Scheme.
…field This is a verbatim translation of the C code into Scheme. In this case, the 4th argument in the processed "PKG_" string is considered the part of the 3rd one, the value.
37eef4b
to
d2cf07a
Compare
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.
The function
pkg-line->element()
has been wholly rewritten inScheme. The following changes have been made:
(sch2pcb element)
has been added. The modulecurrently contains two functions for creating the structure
PcbElement
from a text string in Scheme,pkg-line->element()
, and its helper,free-element
, thatallows for freeing the C foreign instance memory. The former
function has been significantly refactored in Scheme.
PcbElement
fields have been added and moved into the module.
order to cover their base functionality and some corner cases.
maximal number of "PKG_" line arguments in Scheme.
compatibility with the previous C one though can obviously have
some new bugs despite of better testing in UTS :-) It will be
refactored further more than once, I think.