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

Add lexical analysis example #202

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

Conversation

vit0rr
Copy link

@vit0rr vit0rr commented Nov 28, 2024

Hey,
I read the README and tried to add a Project topic using the TOML file, but it added my project as a package. So, I added my project directly to the awesome.gleam file and ran gleam run.

If it is wrong in some way, please let me know

Copy link
Member

@lpil lpil left a comment

Choose a reason for hiding this comment

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

Thank you! I think there's a few things that would need to be improved before this could be an example, to prevent new folks from picking up the wrong conventions.

  • The README has no documentation
  • The public functions have no documentation
  • There's an unused module in the src directory
  • The modules are not within the package's namespace, instead they are in the top level global namespace
  • The token type is using wrong case. "TRUE" means "t_r_u_e" in Gleam

The use of string.slice will make it quite slow also. The string will have to be walked from the start each time, making the cost exponential with the size of the input.

@vit0rr
Copy link
Author

vit0rr commented Nov 29, 2024

Thank you! I think there's a few things that would need to be improved before this could be an example, to prevent new folks from picking up the wrong conventions.

* The README has no documentation

* The public functions have no documentation

* There's an unused module in the `src` directory

* The modules are not within the package's namespace, instead they are in the top level global namespace

* The token type is using wrong case. "TRUE" means "t_r_u_e" in Gleam

The use of string.slice will make it quite slow also. The string will have to be walked from the start each time, making the cost exponential with the size of the input.

Oh, thank you so much for the review! I'll update the code

@vit0rr
Copy link
Author

vit0rr commented Nov 30, 2024

Hey @lpil

I've just updated the code. Could you please check if it is ok now? And by The use of string.slice will make it quite slow also you mean all slices I've used on my code?

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