-
Notifications
You must be signed in to change notification settings - Fork 39
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
sexp: Add missing API: items/pairs/treeRepr/getKey #164
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
haxscramper
force-pushed
the
s-expr-tests
branch
from
January 17, 2022 08:38
7976136
to
4f29694
Compare
saem
reviewed
Jan 17, 2022
I'd put it into the standard library as a next step, honestly super useful elsewhere and the nimsuggest based include is annoying. Could be a next step. |
- expose `.car` and `.cdr` fields for direct access - everything else can already be accesssed, but those were wrapped in weird `getCons()` proc that retunred both elements. - `treeRepr` for S-expression printing - `getKey` for S-expression keyword pair - missing `pairs()` and `mpairs()`
haxscramper
force-pushed
the
s-expr-tests
branch
from
January 17, 2022 09:21
4f29694
to
371bed4
Compare
For now this is just a simple API update, in the future this can be moved to the stdlib, yes, I see no issues with that. |
Bors r+ |
Build succeeded: |
haxscramper
added a commit
to haxscramper/nimskull
that referenced
this pull request
Jan 18, 2022
164: sexp: Add missing API: items/pairs/treeRepr/getKey r=saem a=haxscramper - expose `.car` and `.cdr` fields for direct access - everything else can already be accesssed, but those were wrapped in weird `getCons()` proc that retunred both elements. - `treeRepr` for S-expression printing - `getKey` for S-expression keyword pair - missing `pairs()` and `mpairs()` Co-authored-by: haxscramper <haxscramper@gmail.com>
haxscramper
added a commit
to haxscramper/nimskull
that referenced
this pull request
Jan 28, 2022
- rework implementation of the message diff in testament. Now plaintext diff is implemented using built-in diff written in nim instead of calling into separate `git diff` command that produced noisy, colorless output and was completely unconfigurable. - Add implementation of the structured message diff, structured compiler reports for the compiler. These changes had to be made togehter, otherwise it would've been a series incomplete PRs that depended on each other even for the purposes of testing/documentation. - Add s-expression formatter to the compiler output. Selected using `--msgFormat=sexp` (for now we have a `text` and `sexp`, in the future `json` must be added as well, since that's what people actually expect from their tooling - not some obscure data format). - Fix 'invalid value' error for cli switch - that bug was discovered when adding `msgFormat` option. - Add structural S-expression diff algorithm with formatting logic for mismatches. - Add `nimoutFormat: sexp` field for the testament, to allow it understand what kind of data will be generated by the compiler itself. - Clean up testament message diff handling a little and add checks for structural diffs where appropriate. - Minor related changes - Split `strutils.addf` and reuse the interpolation string for colored text - otherwise all futher formatting logic looked a lot uglier than necessary (using `strformat.&` would require factoring out macro implementation parts) - Clean up testament documentation for different spec parts, add description of the structural messages. - More documentation all over testament implementation - Move `sexp` file into `experimental/` directory - it is no longer related directly to nimsuggest, @saem has already suggested moving it in nim-works#164 - Testament no longer has a hard assertion on the path of the tested file `testament tfile.nim` can also work, and does not force user to create needlessly nested directories for purposes of simple file testing.
haxscramper
added a commit
to haxscramper/nimskull
that referenced
this pull request
Jan 28, 2022
- rework implementation of the message diff in testament. Now plaintext diff is implemented using built-in diff written in nim instead of calling into separate `git diff` command that produced noisy, colorless output and was completely unconfigurable. - Add implementation of the structured message diff, structured compiler reports for the compiler. These changes had to be made togehter, otherwise it would've been a series incomplete PRs that depended on each other even for the purposes of testing/documentation. - Add s-expression formatter to the compiler output. Selected using `--msgFormat=sexp` (for now we have a `text` and `sexp`, in the future `json` must be added as well, since that's what people actually expect from their tooling - not some obscure data format). - Fix 'invalid value' error for cli switch - that bug was discovered when adding `msgFormat` option. - Add structural S-expression diff algorithm with formatting logic for mismatches. - Add `nimoutFormat: sexp` field for the testament, to allow it understand what kind of data will be generated by the compiler itself. - Clean up testament message diff handling a little and add checks for structural diffs where appropriate. - Minor related changes - Split `strutils.addf` and reuse the interpolation string for colored text - otherwise all futher formatting logic looked a lot uglier than necessary (using `strformat.&` would require factoring out macro implementation parts) - Clean up testament documentation for different spec parts, add description of the structural messages. - More documentation all over testament implementation - Move `sexp` file into `experimental/` directory - it is no longer related directly to nimsuggest, @saem has already suggested moving it in nim-works#164 - Testament no longer has a hard assertion on the path of the tested file `testament tfile.nim` can also work, and does not force user to create needlessly nested directories for purposes of simple file testing.
haxscramper
added a commit
to haxscramper/nimskull
that referenced
this pull request
Feb 3, 2022
- rework implementation of the message diff in testament. Now plaintext diff is implemented using built-in diff written in nim instead of calling into separate `git diff` command that produced noisy, colorless output and was completely unconfigurable. - Add implementation of the structured message diff, structured compiler reports for the compiler. These changes had to be made togehter, otherwise it would've been a series incomplete PRs that depended on each other even for the purposes of testing/documentation. - Add s-expression formatter to the compiler output. Selected using `--msgFormat=sexp` (for now we have a `text` and `sexp`, in the future `json` must be added as well, since that's what people actually expect from their tooling - not some obscure data format). - Fix 'invalid value' error for cli switch - that bug was discovered when adding `msgFormat` option. - Add structural S-expression diff algorithm with formatting logic for mismatches. - Add `nimoutFormat: sexp` field for the testament, to allow it understand what kind of data will be generated by the compiler itself. - Clean up testament message diff handling a little and add checks for structural diffs where appropriate. - Minor related changes - Split `strutils.addf` and reuse the interpolation string for colored text - otherwise all futher formatting logic looked a lot uglier than necessary (using `strformat.&` would require factoring out macro implementation parts) - Clean up testament documentation for different spec parts, add description of the structural messages. - More documentation all over testament implementation - Move `sexp` file into `experimental/` directory - it is no longer related directly to nimsuggest, @saem has already suggested moving it in nim-works#164 - Testament no longer has a hard assertion on the path of the tested file `testament tfile.nim` can also work, and does not force user to create needlessly nested directories for purposes of simple file testing.
haxscramper
added a commit
to haxscramper/nimskull
that referenced
this pull request
Feb 3, 2022
- rework implementation of the message diff in testament. Now plaintext diff is implemented using built-in diff written in nim instead of calling into separate `git diff` command that produced noisy, colorless output and was completely unconfigurable. - Add implementation of the structured message diff, structured compiler reports for the compiler. These changes had to be made togehter, otherwise it would've been a series incomplete PRs that depended on each other even for the purposes of testing/documentation. - Add s-expression formatter to the compiler output. Selected using `--msgFormat=sexp` (for now we have a `text` and `sexp`, in the future `json` must be added as well, since that's what people actually expect from their tooling - not some obscure data format). - Fix 'invalid value' error for cli switch - that bug was discovered when adding `msgFormat` option. - Add structural S-expression diff algorithm with formatting logic for mismatches. - Add `nimoutFormat: sexp` field for the testament, to allow it understand what kind of data will be generated by the compiler itself. - Clean up testament message diff handling a little and add checks for structural diffs where appropriate. - Minor related changes - Split `strutils.addf` and reuse the interpolation string for colored text - otherwise all futher formatting logic looked a lot uglier than necessary (using `strformat.&` would require factoring out macro implementation parts) - Clean up testament documentation for different spec parts, add description of the structural messages. - More documentation all over testament implementation - Move `sexp` file into `experimental/` directory - it is no longer related directly to nimsuggest, @saem has already suggested moving it in nim-works#164 - Testament no longer has a hard assertion on the path of the tested file `testament tfile.nim` can also work, and does not force user to create needlessly nested directories for purposes of simple file testing.
haxscramper
added a commit
to haxscramper/nimskull
that referenced
this pull request
Feb 3, 2022
- rework implementation of the message diff in testament. Now plaintext diff is implemented using built-in diff written in nim instead of calling into separate `git diff` command that produced noisy, colorless output and was completely unconfigurable. - Add implementation of the structured message diff, structured compiler reports for the compiler. These changes had to be made togehter, otherwise it would've been a series incomplete PRs that depended on each other even for the purposes of testing/documentation. - Add s-expression formatter to the compiler output. Selected using `--msgFormat=sexp` (for now we have a `text` and `sexp`, in the future `json` must be added as well, since that's what people actually expect from their tooling - not some obscure data format). - Fix 'invalid value' error for cli switch - that bug was discovered when adding `msgFormat` option. - Add structural S-expression diff algorithm with formatting logic for mismatches. - Add `nimoutFormat: sexp` field for the testament, to allow it understand what kind of data will be generated by the compiler itself. - Clean up testament message diff handling a little and add checks for structural diffs where appropriate. - Minor related changes - Split `strutils.addf` and reuse the interpolation string for colored text - otherwise all futher formatting logic looked a lot uglier than necessary (using `strformat.&` would require factoring out macro implementation parts) - Clean up testament documentation for different spec parts, add description of the structural messages. - More documentation all over testament implementation - Move `sexp` file into `experimental/` directory - it is no longer related directly to nimsuggest, @saem has already suggested moving it in nim-works#164 - Testament no longer has a hard assertion on the path of the tested file `testament tfile.nim` can also work, and does not force user to create needlessly nested directories for purposes of simple file testing.
haxscramper
added a commit
to haxscramper/nimskull
that referenced
this pull request
Feb 6, 2022
- rework implementation of the message diff in testament. Now plaintext diff is implemented using built-in diff written in nim instead of calling into separate `git diff` command that produced noisy, colorless output and was completely unconfigurable. - Add implementation of the structured message diff, structured compiler reports for the compiler. These changes had to be made togehter, otherwise it would've been a series incomplete PRs that depended on each other even for the purposes of testing/documentation. - Add s-expression formatter to the compiler output. Selected using `--msgFormat=sexp` (for now we have a `text` and `sexp`, in the future `json` must be added as well, since that's what people actually expect from their tooling - not some obscure data format). - Fix 'invalid value' error for cli switch - that bug was discovered when adding `msgFormat` option. - Add structural S-expression diff algorithm with formatting logic for mismatches. - Add `nimoutFormat: sexp` field for the testament, to allow it understand what kind of data will be generated by the compiler itself. - Clean up testament message diff handling a little and add checks for structural diffs where appropriate. - Minor related changes - Split `strutils.addf` and reuse the interpolation string for colored text - otherwise all futher formatting logic looked a lot uglier than necessary (using `strformat.&` would require factoring out macro implementation parts) - Clean up testament documentation for different spec parts, add description of the structural messages. - More documentation all over testament implementation - Move `sexp` file into `experimental/` directory - it is no longer related directly to nimsuggest, @saem has already suggested moving it in nim-works#164 - Testament no longer has a hard assertion on the path of the tested file `testament tfile.nim` can also work, and does not force user to create needlessly nested directories for purposes of simple file testing.
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.
.car
and.cdr
fields for direct access - everything else canalready be accesssed, but those were wrapped in weird
getCons()
procthat retunred both elements.
treeRepr
for S-expression printinggetKey
for S-expression keyword pairpairs()
andmpairs()