Replies: 3 comments 5 replies
-
Actually re-reading this is may not be recursion at all. I might be mistake, this looks like a state machine? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Yup, it's a state machine, it's very similar to the lexer that Go uses. I really recommend watching the video Lexical Scanning in Go by Rob Pike both to know more and because the video itself is awesome. 😄 |
Beta Was this translation helpful? Give feedback.
0 replies
-
But anyway for the escape sequences iirc there's a function in the Go standard library for that. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Something i noticed while trying to figure out how to add basic support for escape sequences is the way the Lexer is designed, looks like you're using recursion?
For example:
tau/lexer/lexer.go
Lines 142 to 151 in 6b87b87
Is there a risk of blowing up the Go stack here or has Golang itself become quite elver here and uses tail recursion? 😅 (I haven't tested this lately!)
Beta Was this translation helpful? Give feedback.
All reactions