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

Added the ability to install an alternate tokenizer (original PR from my main branch) #12

Closed
wants to merge 10 commits into from

Conversation

brucemack
Copy link
Contributor

Great library! I've added the ability to replace the tokenizer function. I'm using this in an application where I need tokens with spaces (quote delimited). Hopefully this is a reasonable change. Thanks.

@philj404
Copy link
Owner

I am glad you found this library useful!

This change looks promising. Even though it does add a (very) little complexity, it is nicely separated out in a way that will not distract most users, or add much overhead.

  1. Could you add an example (maybe in examples/QuotedSpaceArguments) showing how to add a custom parser? This makes it more obvious to developers why the flexibility can be useful, and how to use it correctly.
  2. It would be helpful to have a unit test to ensure future changes do not break (regress) this new feature. Could you add a unit test (some name like examples/tests/CustomParserTest) to confirm that changing the parser uses the new parser correctly?

And thanks for remembering to update the README!

@brucemack
Copy link
Contributor Author

brucemack commented Dec 29, 2021 via email

@brucemack
Copy link
Contributor Author

When I take Brian Park's latest code (now renamed EpoxyDuino from UnixHostDuino) the SimpeSerialShell unit test are failing. I've traced this to a coincidental change that Brian made in the last few weeks relate to the treatment of line-ending characters in the Print::println() function. For some reason he's changed his mock of the Print class to generate \n instead of \r\n. I don't think this is a good move and I've left him a comment on the commit. I'll see what he comes back with. Meanwhile, I'm going to revert to an earlier version of his library and continue.

I now understand the structure of the unit tests - very cool.

@brucemack
Copy link
Contributor Author

Unit test, example, and some doc updates committed.

@philj404
Copy link
Owner

It has been a while since I added the unit tests, so I may be missing something. Your pull request successfully passed my legacy unit tests yesterday, without the need to change to a new line ending.

Should Brian Parks' upstream changes have caused a failure in my tests?

(Perhaps the old "UnixHostDuino" link doesn't pick up newer changes.)

@@ -1,8 +1,10 @@
# See https://github.com/bxparks/UnixHostDuino for documentation about this
# See https://github.com/bxparks/EpoxyDuino for documentation about this
Copy link
Owner

Choose a reason for hiding this comment

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

Thank you for updating this dependency to match the new name. I had forgotten about it.

Also, thanks for updating the documentation. It really helps when revisiting the code six months later.

Copy link

Choose a reason for hiding this comment

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

https://github.com/bxparks/UnixHostDuino redirects to https://github.com/bxparks/EpoxyDuino, so the old link will still work, but it's better to update to the new link.

@brucemack
Copy link
Contributor Author

brucemack commented Dec 29, 2021 via email

@philj404
Copy link
Owner

Hmm. It looks like the unit tests for this pull request are not running in my environment. I suspect that is because my aunit_tests.yml only run on push. I need to make it run on pull_request too. You are the first contributor that pushed onto a fork. It's hard for me to notice this as an issue, as I have to push to create a pull request. That may be a flaw with EpoxyDuino examples, too (I will follow up).

Since I want to run tests on your code, I want to check out your branch. Your branch's local name -- "main" -- ends up confusing me when I try to pull it into my repository, which has its own idea of "main".

I think I can get it all straightened out, but next time you may want to name your branch to something more obviously related to the change, like brucemack/customTokenizer.

I have plans for the evening. I will experiment tomorrow and let you know what I have learned.

@brucemack
Copy link
Contributor Author

Hi Phil. I have created a branch called brucemack/customTokenizer in my fork and have submitted another PR from this branch, in case that is easier for you. From my perspective both of the PRs are identical so you should work with the one that works best for you. Please decline the other PR to avoid any confusion. Let me know if I can do anything else to make this easier.

@brucemack brucemack changed the title Added the ability to install an alternate tokenizer Added the ability to install an alternate tokenizer (original PR from my main branch) Dec 30, 2021
@philj404
Copy link
Owner

Closing this PR in favor of using #13 . The comments above are still useful though.

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.

None yet

3 participants