diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 834f7163d..00cd8a876 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,12 +17,6 @@ jobs: with: fetch-depth: 0 - - uses: cocogitto/cocogitto-action@v3.8 - with: - check-latest-tag-only: true - git-user: glsl-lang - git-user-email: glsl-lang@alixinne.github.io - - uses: actions/cache@v4 with: key: ${{ runner.os }} @@ -44,6 +38,12 @@ jobs: - name: Check clippy lints run: cargo clippy -- -D warnings -A clippy::result_large_err + - uses: cocogitto/cocogitto-action@v3.8 + with: + check-latest-tag-only: true + git-user: glsl-lang + git-user-email: glsl-lang@alixinne.github.io + test: name: Test crate diff --git a/CHANGELOG.md b/CHANGELOG.md index 736fbd2fa..f16de842a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,14 @@ ## [Unreleased] - - - +## v0.7.0 - 2024-11-11 +#### Features +- **(parser)** add type_qualifier only in decls (#56) - (b71dd7b) - Yorkie Makoto +#### Miscellaneous Chores +- **(version)** v0.6.1 [skip ci] - (8759d96) - glsl-lang + +- - - + ## v0.6.1 - 2024-10-01 #### Bug Fixes - **(transpiler)** append "precision" for precision decl (#53) - (1596970) - Yorkie Makoto diff --git a/lang-cli/Cargo.toml b/lang-cli/Cargo.toml index fafaae894..2d46e9c30 100644 --- a/lang-cli/Cargo.toml +++ b/lang-cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "glsl-lang-cli" -version = "0.6.1" +version = "0.7.0" authors = ["Alixinne "] edition = "2021" license = "BSD-3-Clause" @@ -13,9 +13,9 @@ keywords = ["glsl", "language", "parser", "ast", "cli"] categories = ["command-line-interface", "parser-implementations", "rendering"] [dependencies] -glsl-lang = { version = "=0.6.1", features = ["lexer-v2-full"] } -glsl-lang-pp = { version = "=0.6.1" } -lang-util = "=0.6.1" +glsl-lang = { version = "=0.7.0", features = ["lexer-v2-full"] } +glsl-lang-pp = { version = "=0.7.0" } +lang-util = "=0.7.0" argh = "0.1" serde_json = { version = "1.0", optional = true } diff --git a/lang-lexer/Cargo.toml b/lang-lexer/Cargo.toml index 98ef20edd..9211e9845 100644 --- a/lang-lexer/Cargo.toml +++ b/lang-lexer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "glsl-lang-lexer" -version = "0.6.1" +version = "0.7.0" authors = ["Alixinne "] edition = "2021" license = "BSD-3-Clause" @@ -13,8 +13,8 @@ keywords = ["glsl", "language", "parser"] categories = ["parser-implementations", "rendering"] [dependencies] -glsl-lang-types = "=0.6.1" -lang-util = { version = "=0.6.1", features = ["lalrpop"] } +glsl-lang-types = "=0.7.0" +lang-util = { version = "=0.7.0", features = ["lalrpop"] } thiserror = "1.0" @@ -24,7 +24,7 @@ rserde = { version = "1.0", optional = true, features = ["derive"], package = "s logos = { version = "0.12", optional = true } # v2 lexer dependencies -glsl-lang-pp = { version = "=0.6.1", optional = true } +glsl-lang-pp = { version = "=0.7.0", optional = true } lalrpop-util = { version = "0.20.0", default-features = false, optional = true } [features] diff --git a/lang-pp/Cargo.toml b/lang-pp/Cargo.toml index 24db275c9..6d7c6b073 100644 --- a/lang-pp/Cargo.toml +++ b/lang-pp/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "glsl-lang-pp" -version = "0.6.1" +version = "0.7.0" authors = ["Alixinne "] edition = "2021" license = "BSD-3-Clause" @@ -14,7 +14,7 @@ categories = ["parser-implementations", "rendering"] build = "build.rs" [dependencies] -lang-util = "=0.6.1" +lang-util = "=0.7.0" string_cache = "0.8" thiserror = "1.0" @@ -32,7 +32,7 @@ itertools = { version = "0.13", optional = true } once_cell = { version = "1.17.1", optional = true } [dev-dependencies] -lang-util-dev = "=0.6.1" +lang-util-dev = "=0.7.0" expect-test = "1.3" encoding_rs = "0.8" diff --git a/lang-quote/Cargo.toml b/lang-quote/Cargo.toml index 3b5a71e3a..a6a2653a0 100644 --- a/lang-quote/Cargo.toml +++ b/lang-quote/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "glsl-lang-quote" -version = "0.6.1" +version = "0.7.0" authors = ["Alixinne "] edition = "2021" license = "BSD-3-Clause" @@ -17,7 +17,7 @@ proc-macro = true path = "src/lib.rs" [dependencies] -glsl-lang = { version = "=0.6.1", default-features = false, features = ["lexer-v2-full"] } +glsl-lang = { version = "=0.7.0", default-features = false, features = ["lexer-v2-full"] } proc-macro2 = "1" quote = "1" diff --git a/lang-quote/src/tokenize.rs b/lang-quote/src/tokenize.rs index 812b5478b..a826443b9 100644 --- a/lang-quote/src/tokenize.rs +++ b/lang-quote/src/tokenize.rs @@ -1117,6 +1117,11 @@ fn tokenize_declaration(d: &ast::Declaration) -> TokenStream { let ident = tokenize_identifier(ident); quote! { glsl_lang::ast::DeclarationData::Invariant(#ident) } } + + ast::DeclarationData::TypeOnly(ref q) => { + let q = tokenize_type_qualifier(q); + quote! { glsl_lang::ast::DeclarationData::TypeOnly(#q) } + } }; let span = tokenize_span(&d.span); diff --git a/lang-quote/tests/lib.rs b/lang-quote/tests/lib.rs index 83b9d64e1..9133cbd47 100644 --- a/lang-quote/tests/lib.rs +++ b/lang-quote/tests/lib.rs @@ -125,3 +125,10 @@ fn statement_var_decl() { } }; } + +#[test] +fn typeonly_multiview_qualifier() { + let _ = glsl! { + layout (num_views = 2) in; + }; +} diff --git a/lang-types/Cargo.toml b/lang-types/Cargo.toml index 966bfb6b9..ec0ea3396 100644 --- a/lang-types/Cargo.toml +++ b/lang-types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "glsl-lang-types" -version = "0.6.1" +version = "0.7.0" authors = ["Alixinne "] edition = "2021" license = "BSD-3-Clause" @@ -13,7 +13,7 @@ keywords = ["glsl", "language", "parser"] categories = ["rendering"] [dependencies] -lang-util = "=0.6.1" +lang-util = "=0.7.0" thiserror = "1.0" rserde = { version = "1.0", optional = true, features = ["derive"], package = "serde" } diff --git a/lang-types/src/ast.rs b/lang-types/src/ast.rs index 22032b0d1..8ba8e8186 100644 --- a/lang-types/src/ast.rs +++ b/lang-types/src/ast.rs @@ -991,6 +991,8 @@ pub enum DeclarationData { Block(Block), /// Invariant declaration Invariant(Identifier), + /// Type-only declaration + TypeOnly(TypeQualifier), } impl_node_content! { diff --git a/lang-util-derive/Cargo.toml b/lang-util-derive/Cargo.toml index 1230b9a98..cefedff92 100644 --- a/lang-util-derive/Cargo.toml +++ b/lang-util-derive/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lang-util-derive" -version = "0.6.1" +version = "0.7.0" authors = ["Alixinne "] edition = "2021" license = "BSD-3-Clause" diff --git a/lang-util-dev/Cargo.toml b/lang-util-dev/Cargo.toml index 1782972eb..71a1336df 100644 --- a/lang-util-dev/Cargo.toml +++ b/lang-util-dev/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lang-util-dev" -version = "0.6.1" +version = "0.7.0" authors = ["Alixinne "] edition = "2021" license = "BSD-3-Clause" diff --git a/lang-util/Cargo.toml b/lang-util/Cargo.toml index f6c6e7b84..f4df3590d 100644 --- a/lang-util/Cargo.toml +++ b/lang-util/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lang-util" -version = "0.6.1" +version = "0.7.0" authors = ["Alixinne "] edition = "2021" license = "BSD-3-Clause" @@ -13,7 +13,7 @@ keywords = ["language", "parser", "ast"] categories = ["parsing"] [dependencies] -lang-util-derive = "=0.6.1" +lang-util-derive = "=0.7.0" line-span = "0.1" smol_str = "0.2" text-size = "1.1" diff --git a/lang/Cargo.toml b/lang/Cargo.toml index c84a88e9d..4967e0171 100644 --- a/lang/Cargo.toml +++ b/lang/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "glsl-lang" -version = "0.6.1" +version = "0.7.0" authors = ["Alixinne "] edition = "2021" license = "BSD-3-Clause" @@ -17,10 +17,10 @@ lalrpop-util = { version = "0.20.0", default-features = false, features = ["std" once_cell = "1.17.1" thiserror = "1.0" -lang-util = { version = "=0.6.1", features = ["lalrpop"] } -glsl-lang-pp = { version = "=0.6.1", optional = true } -glsl-lang-lexer = { version = "=0.6.1", features = ["lalrpop"] } -glsl-lang-types = "=0.6.1" +lang-util = { version = "=0.7.0", features = ["lalrpop"] } +glsl-lang-pp = { version = "=0.7.0", optional = true } +glsl-lang-lexer = { version = "=0.7.0", features = ["lalrpop"] } +glsl-lang-types = "=0.7.0" rserde = { version = "1.0", optional = true, features = ["derive"], package = "serde" } @@ -28,8 +28,8 @@ rserde = { version = "1.0", optional = true, features = ["derive"], package = "s lalrpop = "0.20.0" [dev-dependencies] -lang-util-dev = "=0.6.1" -glsl-lang-pp = "=0.6.1" +lang-util-dev = "=0.7.0" +glsl-lang-pp = "=0.7.0" criterion = "0.5" expect-test = "1.3" diff --git a/lang/src/parser.lalrpop b/lang/src/parser.lalrpop index eeaaf2517..5678349b6 100644 --- a/lang/src/parser.lalrpop +++ b/lang/src/parser.lalrpop @@ -694,6 +694,7 @@ declaration: ast::Declaration = { ";" => p.spanned(l, r), ";" => ast::DeclarationData::Block(b).spanned(l, r), "invariant" ";" => ast::DeclarationData::Invariant(i).spanned(l, r), + ";" => ast::DeclarationData::TypeOnly(q).spanned(l, r), }; function_definition: ast::FunctionDefinition = { diff --git a/lang/src/transpiler/glsl.rs b/lang/src/transpiler/glsl.rs index bc9ac078e..cd4687f63 100644 --- a/lang/src/transpiler/glsl.rs +++ b/lang/src/transpiler/glsl.rs @@ -1540,6 +1540,9 @@ where f.write_char(' ')?; show_identifier(f, ident, state)?; } + ast::DeclarationData::TypeOnly(ref q) => { + show_type_qualifier(f, q, state)?; + } } state.write_declaration_terminator(f) diff --git a/lang/src/visitor.rs b/lang/src/visitor.rs index 0617b9f72..23d94a44f 100644 --- a/lang/src/visitor.rs +++ b/lang/src/visitor.rs @@ -740,6 +740,8 @@ macro_rules! make_host_trait { ast::DeclarationData::Block(block) => block.$mthd_name(visitor), ast::DeclarationData::Invariant(ident) => ident.$mthd_name(visitor), + + ast::DeclarationData::TypeOnly(q) => q.$mthd_name(visitor), } } } diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml index 068d3068e..1c347e99d 100644 --- a/xtask/Cargo.toml +++ b/xtask/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "xtask" -version = "0.6.1" +version = "0.7.0" edition = "2021" [dependencies]