Skip to content

compiler: cosmetic changes #207

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

Closed
wants to merge 1 commit into from
Closed

Conversation

chqrlie
Copy link
Contributor

@chqrlie chqrlie commented Apr 6, 2025

  • fix Writer.getError() messages
  • import string as local for consistency
  • add startsWith(const char* text, const char* prefix, const char** pp)
  • more cosmetic changes

@chqrlie chqrlie force-pushed the cosmetics branch 2 times, most recently from 1828640 to 43971d5 Compare April 14, 2025 06:55
@bvdberg
Copy link
Member

bvdberg commented Apr 14, 2025

Why did you add the startsWith() function? It is not used at all. We'r not building libc (yet) ;)

@chqrlie chqrlie force-pushed the cosmetics branch 3 times, most recently from f145e18 to 1cd8528 Compare April 15, 2025 20:01
@chqrlie
Copy link
Contributor Author

chqrlie commented Apr 15, 2025

I implemented startsWith() for consistency with endsWith, but I have not used startsWith() yet.

tools/tester/test_db.c2 has a number of tests for prefixes that have hard coded lengths that would benefit from a simpler API, possibly returning the pointer to the next character or returning it via a pointer.

Note that there is a similar function starts_with in the yaml parser that has a different API and performs an extra check for a trailing '.' which is a bit counterintuitive.

We can discuss a good API for this. I have removed the current implementation of startsWidth() for now.

@chqrlie chqrlie force-pushed the cosmetics branch 3 times, most recently from bab9ca7 to 1501c0e Compare April 18, 2025 06:46
* fix `Writer.getError()` messages
* import string as local for consistency
* more cosmetic changes
@chqrlie chqrlie closed this Apr 19, 2025
@chqrlie chqrlie deleted the cosmetics branch April 19, 2025 09:42
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