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

Rethink line of code into action (method call) and result (assignment) #11

Open
CodesAway opened this issue Dec 12, 2020 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@CodesAway
Copy link
Owner

CodesAway commented Dec 12, 2020

Most lines of code do something, call a method, and store the result.

Focus on method invocations as main element in line of code, then add small grammar to supplement

  1. Invoke method and store result
  2. If statement with method or variable
  3. If condition variable with method or variable conditions separated by "and" / "or"

Focus on parsing line up to determine method name. Then, small grammar to handle what to do with the result.

@CodesAway CodesAway added the enhancement New feature or request label Dec 12, 2020
@CodesAway
Copy link
Owner Author

CodesAway commented Dec 23, 2020

Like idea of allowing "as" followed by the variable name for assignment (similar to SQL) .

This is similar to the "var" added in Java 10. Can determine type based on return from method call. If compiling against Java 10 or higher, could have option to specify var instead of type.

Could also allow "var" to use var syntax and "val" to have final var (similar to Kotlin).

Example
something to string as variable name

Would yield code
String variableName = something.toString();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant