Skip to content
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

Quote stripping in log command #4429

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Quote stripping in log command #4429

wants to merge 7 commits into from

Conversation

KrystalDelusion
Copy link
Member

@KrystalDelusion KrystalDelusion commented Jun 5, 2024

What are the reasons/motivation for this change?

Allows e.g. log "yosys> flatten;;", logging the unquoted text yosys> flatten;;.

Explain how this is achieved.

If the text to log starts and ends with a quotation mark, drop the first and last characters.

If applicable, please suggest to reviewers how they can test the change.

@KrystalDelusion KrystalDelusion changed the title Quote stripping in commands Quote stripping in log command Jun 7, 2024
@KrystalDelusion KrystalDelusion marked this pull request as ready for review June 8, 2024 01:11

test_log "test" "test"
test_log "test;" "test"
test_log "test;;" "test"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Allows e.g. log "yosys> flatten;;", logging the unquoted text yosys> flatten;;.

Doesn't this line test that the semicolons would be discarded?

Copy link
Member Author

@KrystalDelusion KrystalDelusion Jul 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, contrast with the later test_log "\"test;;\"" "test;;" which tests if putting them in quotes prevents removing them, i.e. "\"test;;\"" -> log "test;;" because bash doesn't include the outer quotes when doing the variable substitution.

@KrystalDelusion KrystalDelusion added the merge-after-jf Merge: PR will be merged after the next Dev JF unless concerns are raised label Jul 18, 2024
Currently provides tests for logging quoted strings.
We can now fake the `yosys> flatten;;` line, so we no longer need to explain the split flatten/clean.
If a command has a single argument, and that argument is quoted, strip the quotes.
`log "` should log `"`.
Also fix test script to correctly fail when more than one test fails.
@KrystalDelusion KrystalDelusion removed the merge-after-jf Merge: PR will be merged after the next Dev JF unless concerns are raised label Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants