diff --git a/README.md b/README.md index 3c374c4e84..cd547c5d80 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Naga -[![Matrix](https://img.shields.io/badge/Matrix-%23gfx%3Amatrix.org-blueviolet.svg)](https://matrix.to/#/#gfx:matrix.org) +[![Matrix](https://img.shields.io/badge/Matrix-%23naga%3Amatrix.org-blueviolet.svg)](https://matrix.to/#/#naga:matrix.org) [![Crates.io](https://img.shields.io/crates/v/naga.svg?label=naga)](https://crates.io/crates/naga) [![Docs.rs](https://docs.rs/naga/badge.svg)](https://docs.rs/naga) [![Build Status](https://travis-ci.org/gfx-rs/naga.svg?branch=master)](https://travis-ci.org/gfx-rs/naga) diff --git a/grammars/wgsl.pest b/grammars/wgsl.pest index c24d10b02f..56de1fc21c 100644 --- a/grammars/wgsl.pest +++ b/grammars/wgsl.pest @@ -121,8 +121,8 @@ scalar_type = { | "u32" } -return_statement = { "return" ~ primary_expression? } -assignment_statement = { ident ~ "=" ~ primary_expression } +return_statement = { "return" ~ logical_or_expression? } +assignment_statement = { ident ~ "=" ~ logical_or_expression } statement = { ";" @@ -179,8 +179,8 @@ typed_expression = { type_decl ~ "(" ~ argument_expression_list ~ ")" } argument_expression_list = _{ (logical_or_expression ~ ",")* ~ logical_or_expression } ident = @{ ASCII_ALPHA ~ (ASCII_ALPHANUMERIC | "_")* } -int_literal = @{ ("-"? ~ "0x"? ~ ASCII_HEX_DIGIT+) | "0" | ("-"? ~ ASCII_NONZERO_DIGIT ~ ASCII_DIGIT*) } -uint_literal = @{ ("0x"? ~ ASCII_HEX_DIGIT+) | "0" | (ASCII_NONZERO_DIGIT ~ ASCII_DIGIT*) } +int_literal = @{ ("-"? ~ "0x" ~ ASCII_HEX_DIGIT+) | "0" | ("-"? ~ ASCII_NONZERO_DIGIT ~ ASCII_DIGIT*) } +uint_literal = @{ ("0x" ~ ASCII_HEX_DIGIT+) | "0" | (ASCII_NONZERO_DIGIT ~ ASCII_DIGIT*) } float_literal = @{ "-"? ~ ASCII_DIGIT+ ~ ("." ~ ASCII_DIGIT*)? } bool_literal = @{ "true" | "false" } string_literal = @{ "\"" ~ ( "\"\"" | (!"\"" ~ ANY) )* ~ "\"" } diff --git a/test-data/quad.wgsl b/test-data/quad.wgsl index 3f5bd53914..2666ea1e74 100644 --- a/test-data/quad.wgsl +++ b/test-data/quad.wgsl @@ -6,7 +6,7 @@ const c_scale: f32 = 1.2; [[builtin position]] var o_position : vec4; fn main_vert() -> void { - o_position = vec4(scale * a_pos, 0.0, 1.0); + o_position = vec4(c_scale * a_pos, 0.0, 1.0); return; } entry_point vertex as "main" = main_vert;