Skip to content

Parsing of an array fails if no space before the equal sign #1249

@Popov72

Description

@Popov72

Is it expected that this fails with "expected '>' for array declaration" (Tint from latest Chrome Canary):

const pos : array<vec2<f32>, 4>= array<vec2<f32>, 4>(
    vec2<f32>(-1.0, 1.0),
    vec2<f32>(1.0, 1.0),
    vec2<f32>(-1.0, -1.0),
    vec2<f32>(1.0, -1.0)
);

?

It fails because there's no space between > and = in const pos : array<vec2<f32>, 4>= array<vec2<f32>, 4>(.
Adding a space make it work:

const pos : array<vec2<f32>, 4> = array<vec2<f32>, 4>(
    vec2<f32>(-1.0, 1.0),
    vec2<f32>(1.0, 1.0),
    vec2<f32>(-1.0, -1.0),
    vec2<f32>(1.0, -1.0)
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    wgslWebGPU Shading Language Issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions