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

Cannot do literal.property #15

Closed
ProjectMoon opened this issue Apr 24, 2011 · 0 comments
Closed

Cannot do literal.property #15

ProjectMoon opened this issue Apr 24, 2011 · 0 comments

Comments

@ProjectMoon
Copy link
Owner

Literals are implicit clone statements, so if a property is attached to the proper prototype, the literal should be able to access it. None seem to work. int literals throw a scope error. string literals throw a syntax error.

I think it should be a syntax error to do literal.property simply because of the double data type. Parentheses around a literal should work, however. There are two root problems here:

  1. dots are treated as part of an identifier, not an expression.
  2. the interpreter seems to just throw out expressions that are not assigned to anything.

Dots will have to become an expression somehow. It will require a massive rethinking in ScopeManager. It may make the logic simpler though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant