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

github.com/talon-one/talang/lexer is a parser #4

Open
ghost opened this issue Sep 2, 2019 · 0 comments
Open

github.com/talon-one/talang/lexer is a parser #4

ghost opened this issue Sep 2, 2019 · 0 comments

Comments

@ghost
Copy link

ghost commented Sep 2, 2019

The package github.com/talon-one/lexer is a parser, and there is parsing related code in github.com/talon-one/token. I think that clarifying the grammar and making a single package for parsing would be beneficial. So far I think the grammar is something like:

expression = callBody | parCall | value.
parCall = "(" callBody ")".
callBody = word {arg}.
arg = word | value | parCall.
value = string | decimal | time | boolean.

With word, string, decimal, time and boolean being terminal symbols.

Also https://github.com/talon-one/talang/tree/master/docs suggests that "Mon Jan 2 15:04:05 MST 2006" is a valid time, while

b.Time, err = time.Parse(time.RFC3339, text)
assumes that the correct format is time.RFC3339. I think the assumption is right since the former format has spaces and that makes it harder to parse in this context, but the documentation is confusing.

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

No branches or pull requests

0 participants