-
Notifications
You must be signed in to change notification settings - Fork 1
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
lex: advancement in lexer implementation #13
Conversation
Signed-off-by: FedericoBruzzone <[email protected]>
085657d
to
14d813d
Compare
Signed-off-by: FedericoBruzzone <[email protected]> Co-authored-by: Federico Guerinoni <[email protected]>
14d813d
to
fffb17d
Compare
Signed-off-by: FedericoBruzzone <[email protected]>
list
initializationSigned-off-by: FedericoBruzzone <[email protected]>
Signed-off-by: FedericoBruzzone <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@guerinoni let me know
@@ -0,0 +1 @@ | |||
x_func: () -> unit = () -> print "hello" ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case print
what is it? identifier but why? later can be parsed and found as another func?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function invocation does not require ().
I expect that when visiting the AST we will have a symbol table in that we will have all our functions, BUT at the same time we will have a separate symbol table for the functions that our stdlib will provide.
In this case in the symbol table of the stdlib there will be defined the print (and probably the Optional type, hd
function to get the head of a list etc...)
TokenKind::TokenPlus => write!(f, "TokenPlus"), | ||
TokenKind::TokenMinus => write!(f, "TokenMinus"), | ||
TokenKind::TokenMultiply => write!(f, "TokenMultiply"), | ||
TokenKind::TokenDivide => write!(f, "TokenDivide"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should add those also for assignment/initialization
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean by this comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Support for
x = x + 1
and friends
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should already be covered!
I'll try to write two tests to add to this PR 👍
list
initializationtuple
initializationunit
typefunction
initialization+
,-
,*
,/
(basic)operators
in functionsStateSymbol
struct