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

Conversation

@bvssvni
Copy link
Member

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.

bvssvni added some commits May 22, 2016

Swizzle for vec4
- 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
Take swizzling into account when checking lifetime
- Added “syntax/lifetime_11.dyon”
Type check swizzle
- Added “typechk/call_3.dyon”
- Added “typechk/call_4.dyon”
Type check vec4
- 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 bvssvni:swizzle branch May 22, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.