-
Notifications
You must be signed in to change notification settings - Fork 2
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 typeof
keyword
#18
Labels
Comments
albeva
added a commit
that referenced
this issue
Mar 2, 2022
This allows instantiating parser with other token input sources than a lexer.
albeva
added a commit
that referenced
this issue
Mar 4, 2022
…y tries to parse a type and if that fails than try parse an expression.
albeva
added a commit
that referenced
this issue
Mar 4, 2022
albeva
added a commit
that referenced
this issue
Mar 5, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Support deducing type from a given expression. Similar to C++
decltype
Example:
Grammer:
Limitations
Because types and functions can be declared out of order and invoked without forward declarations - it is far too complex to allow type aliases or function parameters / return type to be deduced from
typeof()
expression. So for now implement only for variable declarations.The problem is with indirect type deductions. Because currently type declarations are parsed first and only then regular statements, it is far too complex to resolve this in a reasonably simple way:
The text was updated successfully, but these errors were encountered: