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

Allow constant-only expressions in source #6

Open
davemenendez opened this issue Aug 11, 2014 · 1 comment
Open

Allow constant-only expressions in source #6

davemenendez opened this issue Aug 11, 2014 · 1 comment

Comments

@davemenendez
Copy link
Contributor

At present, the following is disallowed, because expressions are not permitted in the source:

%1 = or undef, 1
%2 = and undef, ~1
%3 = add %1, %2
%4 = and %3, 1
 =>
%4 = 1

This could be resolved by

  1. Adding initial ~ to the syntax for numeric literals.
  2. Permitting constant expressions which contain no inputs in the source. This could be done by folding expressions to constants during the parse action.

Adding general support for expressions in the source is not recommended, as this makes the C++ translation too complex.

@davemenendez
Copy link
Contributor Author

On further thought, it should be feasible to allow constant expressions in the source as long as they don't introduce new variables.

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