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

all: Cleanup lexing, comments and sample #121

Merged
merged 3 commits into from
Apr 18, 2023
Merged

all: Cleanup lexing, comments and sample #121

merged 3 commits into from
Apr 18, 2023

Conversation

juliaogris
Copy link
Member

This PR continains various minor cleanups:

  • lexing: Make empty string lexing consistent and clearer in JS and go
  • index.js: Group exported funcs, fix comments, remove debug prints
  • improve "guess my number" sample

Improve "Guess my Number" sample by reducing the lines of code and
fixing a typo in the comments.
Clean up index.js by

- grouping exported funcs (canvas )
- removing left over console.logs
- adding a `.` to all comments
@github-actions
Copy link

github-actions bot commented Apr 18, 2023

firebase-deployment: https://evy-lang--121-w5adllqf.web.app (74007db)

Copy link
Member

@camh- camh- left a comment

Choose a reason for hiding this comment

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

🐉

@@ -191,15 +191,15 @@ func (l *Lexer) readIdent() string {

func (l *Lexer) readString() (string, error) {
pos := l.pos
backslashCnt := 0
escaped := false
for {
if l.cur == '\\' {
Copy link
Member

Choose a reason for hiding this comment

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

you could get "fancy" and just say escaped = l.cur == '\\' && !escaped. Perhaps that is a little too obtuse? (same in the JS too)

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, i think even though this is a little "fancy" it is worth doing for the reduction in code size. updated.

Clean up empty string literal lexing in go - lexer - and in JS - editor
syntax colouring lexer. In the editor we actually had an error for
escaped `\"` which wasn't highlighted properly.
@juliaogris juliaogris merged commit d8cb1ba into master Apr 18, 2023
@juliaogris juliaogris deleted the housekeeping branch April 18, 2023 02:00
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