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

Unpacking vector / swizzle notation #212

Merged
merged 5 commits into from
May 22, 2016
Merged

Conversation

bvssvni
Copy link
Member

@bvssvni bvssvni commented May 22, 2016

Closes #209

This PR adds unpacking vector / swizzle notation.

Example:

f(x: f64, y: f64) = { ... }

v := (1, 2)
u := f(xy v) // take `x` and `y` from `v`

Another example:

a := (1, 2)
b := (yx a,) // swap `x` and `y`

For more information, see #213.

- Allow `(2,)` as vec4 syntax to use `(xyzw v,)`
- Resolve locals for vec4 by taking into account swizzles
- Added `ast::Swizzle`
- Skip evaluating expressions in vec4 if swizzling pushes arguments
- Added “syntax/lifetime_11.dyon”
- Added “typechk/call_3.dyon”
- Added “typechk/call_4.dyon”
- Added “typechk/vec4.dyon”
@bvssvni bvssvni changed the title Unpacking vector / swizzling notation Unpacking vector / swizzle notation May 22, 2016
@bvssvni bvssvni merged commit 394017c into PistonDevelopers:master May 22, 2016
@bvssvni bvssvni deleted the swizzle branch May 22, 2016 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant