From 65b144f8b2dba4d19ee8025c9e428c391997d427 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 16:41:18 +0000 Subject: [PATCH 01/10] fix(deps): update all non-major dependencies --- .github/workflows/build.yml | 4 ++-- fuzz/Cargo.toml | 2 +- lang-pp/Cargo.toml | 2 +- lang-util-derive/Cargo.toml | 2 +- lang-util/Cargo.toml | 2 +- lang/Cargo.toml | 2 +- rust-toolchain.toml | 2 +- xtask/Cargo.toml | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7d924961c..834f7163d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,7 @@ jobs: with: fetch-depth: 0 - - uses: cocogitto/cocogitto-action@v3.5 + - uses: cocogitto/cocogitto-action@v3.8 with: check-latest-tag-only: true git-user: glsl-lang @@ -155,7 +155,7 @@ jobs: && cargo-workspaces -V ) - - uses: cocogitto/cocogitto-action@v3.5 + - uses: cocogitto/cocogitto-action@v3.8 id: release # Set to true because the action fails if there's nothing to release continue-on-error: true diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml index 9bc3795ef..a2a69534f 100644 --- a/fuzz/Cargo.toml +++ b/fuzz/Cargo.toml @@ -23,5 +23,5 @@ path = "src/bin/lang_test.rs" [dependencies] glsl-lang-pp = "*" glsl-lang = "*" -afl = "0.11" +afl = "0.15" argh = "0.1.5" diff --git a/lang-pp/Cargo.toml b/lang-pp/Cargo.toml index f664dc90f..adf5ceb27 100644 --- a/lang-pp/Cargo.toml +++ b/lang-pp/Cargo.toml @@ -26,7 +26,7 @@ rowan = { version = "0.15", optional = true } cbitset = { version = "0.2", optional = true } static_assertions = { version = "1.1", optional = true } bimap = { version = "0.6", optional = true } -itertools = { version = "0.10", optional = true } +itertools = { version = "0.13", optional = true } # Extension registry once_cell = { version = "1.17.1", optional = true } diff --git a/lang-util-derive/Cargo.toml b/lang-util-derive/Cargo.toml index c5703777a..293794df0 100644 --- a/lang-util-derive/Cargo.toml +++ b/lang-util-derive/Cargo.toml @@ -17,7 +17,7 @@ path = "src/lib.rs" proc-macro = true [dependencies] -darling = "0.14" +darling = "0.20" proc-macro2 = "1.0" quote = "1.0" syn = "1.0" diff --git a/lang-util/Cargo.toml b/lang-util/Cargo.toml index 569a0a75f..7a89a4b9f 100644 --- a/lang-util/Cargo.toml +++ b/lang-util/Cargo.toml @@ -15,7 +15,7 @@ categories = ["parsing"] [dependencies] lang-util-derive = "=0.5.3" line-span = "0.1" -smol_str = "0.1" +smol_str = "0.2" text-size = "1.1" derive_more = "0.99" diff --git a/lang/Cargo.toml b/lang/Cargo.toml index ca1e2c348..9c44192e0 100644 --- a/lang/Cargo.toml +++ b/lang/Cargo.toml @@ -31,7 +31,7 @@ lalrpop = "0.20.0" lang-util-dev = "=0.5.3" glsl-lang-pp = "=0.5.3" -criterion = "0.3" +criterion = "0.5" expect-test = "1.3" glsl = "7" diff --git a/rust-toolchain.toml b/rust-toolchain.toml index b60c56b6c..ff6d7a9a8 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "1.74.0" +channel = "1.80.0" components = ["rustfmt", "clippy"] profile = "minimal" diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml index 5b55be3c9..989517935 100644 --- a/xtask/Cargo.toml +++ b/xtask/Cargo.toml @@ -6,4 +6,4 @@ edition = "2021" [dependencies] anyhow = "1.0" argh = "0.1" -heck = "0.4" +heck = "0.5" From 19020474167f8b6c10d7950c3a01a673adc9ac35 Mon Sep 17 00:00:00 2001 From: Alixinne Date: Mon, 19 Aug 2024 20:18:27 +0200 Subject: [PATCH 02/10] feat: rename lang_util(as) to lang_util(parser) This is due to upgrading to syn v2, where as is parsed as a keyword by parse_args(). To avoid re-implementing a parser for parse_nested_meta, we just rename this argument to parser which isn't a reserved keyword. --- .cargo/{config => config.toml} | 0 lang-lexer/src/token.rs | 74 +++++++++++++++-------------- lang-pp/src/processor/definition.rs | 2 +- lang-pp/src/types/token.rs | 20 ++++---- lang-util-derive/Cargo.toml | 2 +- lang-util-derive/src/token.rs | 44 +++++++++-------- 6 files changed, 75 insertions(+), 67 deletions(-) rename .cargo/{config => config.toml} (100%) diff --git a/.cargo/config b/.cargo/config.toml similarity index 100% rename from .cargo/config rename to .cargo/config.toml diff --git a/lang-lexer/src/token.rs b/lang-lexer/src/token.rs index 2d62c176e..f24855d41 100644 --- a/lang-lexer/src/token.rs +++ b/lang-lexer/src/token.rs @@ -766,9 +766,9 @@ pub enum Token { feature = "v1", regex("#\\s*\\(\\s*[a-zA-Z_][a-zA-Z_0-9]*\\s*\\)", parse_rs_ident) )] - #[lang_util(as = "ident", kind = "identifier")] + #[lang_util(parser = "ident", kind = "identifier")] Identifier(SmolStr), - #[lang_util(as = "ty_name", kind = "type name")] + #[lang_util(parser = "ty_name", kind = "type name")] TypeName(SmolStr), // Cast from Identifier depending on known type names #[cfg_attr( feature = "v1", @@ -778,21 +778,21 @@ pub enum Token { ) )] #[cfg_attr(feature = "v1", regex(r"[0-9]+[eE][+-]?[0-9]+(f|F)?", parse_f32))] - #[lang_util(as = "float_constant", kind = "literal")] + #[lang_util(parser = "float_constant", kind = "literal")] FloatConstant(f32), #[cfg_attr(feature = "v1", regex(r"0[0-7]*", |lex| parse_int(lex, 8)))] #[cfg_attr(feature = "v1", regex(r"[1-9][0-9]*", |lex| parse_int(lex, 10)))] #[cfg_attr(feature = "v1", regex(r"0[xX][0-9A-Fa-f]+", |lex| parse_int(lex, 16)))] - #[lang_util(as = "int_constant", kind = "literal")] + #[lang_util(parser = "int_constant", kind = "literal")] IntConstant(i32), #[cfg_attr(feature = "v1", regex(r"0[0-7]*[uU]", |lex| parse_uint(lex, 8)))] #[cfg_attr(feature = "v1", regex(r"[1-9][0-9]*[uU]", |lex| parse_uint(lex, 10)))] #[cfg_attr(feature = "v1", regex(r"0[xX][0-9A-Fa-f]+[uU]", |lex| parse_uint(lex, 16)))] - #[lang_util(as = "uint_constant", kind = "literal")] + #[lang_util(parser = "uint_constant", kind = "literal")] UIntConstant(u32), #[cfg_attr(feature = "v1", token("true", |_| true))] #[cfg_attr(feature = "v1", token("false", |_| false))] - #[lang_util(as = "bool_constant", kind = "literal")] + #[lang_util(parser = "bool_constant", kind = "literal")] BoolConstant(bool), #[cfg_attr( feature = "v1", @@ -802,7 +802,7 @@ pub enum Token { ) )] #[cfg_attr(feature = "v1", regex(r"[0-9]+[eE][+-]?[0-9]+(lf|LF)", parse_f64))] - #[lang_util(as = "double_constant", kind = "literal")] + #[lang_util(parser = "double_constant", kind = "literal")] DoubleConstant(f64), #[cfg_attr(feature = "v1", token("<<"))] #[lang_util(token = "<<", kind = "binary operator", kind = "operator")] @@ -974,89 +974,93 @@ pub enum Token { // TODO: Line continuation can happen inside tokens #[cfg_attr(feature = "v1", regex("([ \t\r\n]|\\\\\r?\n)+", logos::skip))] - #[lang_util(display = "", as(display), kind = "trivia")] + #[lang_util(display = "", parser(display), kind = "trivia")] Whitespace, #[cfg_attr(feature = "v1", regex("//(.|\\\\\r?\n)*", |lex| { parse_cmt(lex, true); logos::Skip }))] - #[lang_util(display = "", as(display), kind = "trivia")] + #[lang_util(display = "", parser(display), kind = "trivia")] SingleLineComment, #[cfg_attr(feature = "v1", regex("/\\*([^*]|\\*[^/])+\\*/", |lex| { parse_cmt(lex, false); logos::Skip }))] - #[lang_util(display = "", as(display), kind = "trivia")] + #[lang_util(display = "", parser(display), kind = "trivia")] MultiLineComment, // TODO: Line continuations in preprocessor pragmas? #[cfg_attr(feature = "v1", regex("#([ \t]|\\\\\r?\n)*define"))] - #[lang_util(display = "#define", as(display), kind = "preprocessor directive")] + #[lang_util(display = "#define", parser(display), kind = "preprocessor directive")] PpDefine, #[cfg_attr(feature = "v1", regex("#([ \t]|\\\\\r?\n)*else"))] - #[lang_util(display = "#else", as(display), kind = "preprocessor directive")] + #[lang_util(display = "#else", parser(display), kind = "preprocessor directive")] PpElse, #[cfg_attr(feature = "v1", regex("#([ \t]|\\\\\r?\n)*elif"))] - #[lang_util(display = "#elif", as(display), kind = "preprocessor directive")] + #[lang_util(display = "#elif", parser(display), kind = "preprocessor directive")] PpElif, #[cfg_attr(feature = "v1", regex("#([ \t]|\\\\\r?\n)*endif"))] - #[lang_util(display = "#endif", as(display), kind = "preprocessor directive")] + #[lang_util(display = "#endif", parser(display), kind = "preprocessor directive")] PpEndIf, #[cfg_attr(feature = "v1", regex("#([ \t]|\\\\\r?\n)*error"))] - #[lang_util(display = "#error", as(display), kind = "preprocessor directive")] + #[lang_util(display = "#error", parser(display), kind = "preprocessor directive")] PpError, #[cfg_attr(feature = "v1", regex("#([ \t]|\\\\\r?\n)*if"))] - #[lang_util(display = "#if", as(display), kind = "preprocessor directive")] + #[lang_util(display = "#if", parser(display), kind = "preprocessor directive")] PpIf, #[cfg_attr(feature = "v1", regex("#([ \t]|\\\\\r?\n)*ifdef"))] - #[lang_util(display = "#ifdef", as(display), kind = "preprocessor directive")] + #[lang_util(display = "#ifdef", parser(display), kind = "preprocessor directive")] PpIfDef, #[cfg_attr(feature = "v1", regex("#([ \t]|\\\\\r?\n)*ifndef"))] - #[lang_util(display = "#ifndef", as(display), kind = "preprocessor directive")] + #[lang_util(display = "#ifndef", parser(display), kind = "preprocessor directive")] PpIfNDef, #[cfg_attr(feature = "v1", regex("#([ \t]|\\\\\r?\n)*include"))] - #[lang_util(display = "#include", as(display), kind = "preprocessor directive")] + #[lang_util(display = "#include", parser(display), kind = "preprocessor directive")] PpInclude, #[cfg_attr(feature = "v1", regex("#([ \t]|\\\\\r?\n)*line"))] - #[lang_util(display = "#line", as(display), kind = "preprocessor directive")] + #[lang_util(display = "#line", parser(display), kind = "preprocessor directive")] PpLine, #[cfg_attr(feature = "v1", regex("#([ \t]|\\\\\r?\n)*pragma"))] - #[lang_util(display = "#pragma", as(display), kind = "preprocessor directive")] + #[lang_util(display = "#pragma", parser(display), kind = "preprocessor directive")] PpPragma, #[cfg_attr(feature = "v1", regex("#([ \t]|\\\\\r?\n)*undef"))] - #[lang_util(display = "#undef", as(display), kind = "preprocessor directive")] + #[lang_util(display = "#undef", parser(display), kind = "preprocessor directive")] PpUndef, #[cfg_attr(feature = "v1", regex("#([ \t]|\\\\\r?\n)*version"))] - #[lang_util(display = "#version", as(display), kind = "preprocessor directive")] + #[lang_util(display = "#version", parser(display), kind = "preprocessor directive")] PpVersion, #[cfg_attr(feature = "v1", regex("#([ \t]|\\\\\r?\n)*extension"))] - #[lang_util(display = "#extension", as(display), kind = "preprocessor directive")] + #[lang_util( + display = "#extension", + parser(display), + kind = "preprocessor directive" + )] PpExtension, #[lang_util( display = "", - as(display), + parser(display), kind = "preprocessor string" )] PpRest(String), - #[lang_util(display = "core", as(display), kind = "version profile")] + #[lang_util(display = "core", parser(display), kind = "version profile")] PpCore, - #[lang_util(display = "compatibility", as(display), kind = "version profile")] + #[lang_util(display = "compatibility", parser(display), kind = "version profile")] PpCompatibility, - #[lang_util(display = "es", as(display), kind = "version profile")] + #[lang_util(display = "es", parser(display), kind = "version profile")] PpEs, - #[lang_util(display = "require", as(display), kind = "extension behavior")] + #[lang_util(display = "require", parser(display), kind = "extension behavior")] PpExtRequire, - #[lang_util(display = "enable", as(display), kind = "extension behavior")] + #[lang_util(display = "enable", parser(display), kind = "extension behavior")] PpExtEnable, - #[lang_util(display = "warn", as(display), kind = "extension behavior")] + #[lang_util(display = "warn", parser(display), kind = "extension behavior")] PpExtWarn, - #[lang_util(display = "disable", as(display), kind = "extension behavior")] + #[lang_util(display = "disable", parser(display), kind = "extension behavior")] PpExtDisable, - #[lang_util(display = "<{}>", as(display), kind = "include path")] + #[lang_util(display = "<{}>", parser(display), kind = "include path")] PpPathAbsolute(String), - #[lang_util(display = "\"{}\"", as(display), kind = "include path")] + #[lang_util(display = "\"{}\"", parser(display), kind = "include path")] PpPathRelative(String), #[cfg_attr(feature = "v1", error)] - #[lang_util(display = "", as(display), kind = "error")] + #[lang_util(display = "", parser(display), kind = "error")] Error, } diff --git a/lang-pp/src/processor/definition.rs b/lang-pp/src/processor/definition.rs index 2dc54fc3c..2eac13dd6 100644 --- a/lang-pp/src/processor/definition.rs +++ b/lang-pp/src/processor/definition.rs @@ -838,7 +838,7 @@ impl<'d> MacroInvocation<'d> { // spec-defined expected result. let result: Vec<_> = events .into_iter() - .group_by(Event::is_token) + .chunk_by(Event::is_token) .into_iter() .flat_map(|(is_token, events)| { if is_token { diff --git a/lang-pp/src/types/token.rs b/lang-pp/src/types/token.rs index 840b1cd8c..7041d7476 100644 --- a/lang-pp/src/types/token.rs +++ b/lang-pp/src/types/token.rs @@ -1160,25 +1160,25 @@ impl TypeName { #[allow(non_camel_case_types)] pub enum Token { /// Identifier - #[lang_util(as = "IDENT", kind = "identifier")] + #[lang_util(parser = "IDENT", kind = "identifier")] IDENT(SmolStr), /// Type name - #[lang_util(as = "TYPE_NAME", kind = "type name")] + #[lang_util(parser = "TYPE_NAME", kind = "type name")] TYPE_NAME(TypeName), /// Float constant - #[lang_util(as = "FLOAT_CONST", kind = "float constant", kind = "literal")] + #[lang_util(parser = "FLOAT_CONST", kind = "float constant", kind = "literal")] FLOAT_CONST(f32), /// Int constant - #[lang_util(as = "INT_CONST", kind = "int constant", kind = "literal")] + #[lang_util(parser = "INT_CONST", kind = "int constant", kind = "literal")] INT_CONST(i32), /// Unsigned int constant - #[lang_util(as = "UINT_CONST", kind = "uint constant", kind = "literal")] + #[lang_util(parser = "UINT_CONST", kind = "uint constant", kind = "literal")] UINT_CONST(u32), /// Bool constant - #[lang_util(as = "BOOL_CONST", kind = "bool constant", kind = "literal")] + #[lang_util(parser = "BOOL_CONST", kind = "bool constant", kind = "literal")] BOOL_CONST(bool), /// Double constant - #[lang_util(as = "DOUBLE_CONST", kind = "double constant", kind = "literal")] + #[lang_util(parser = "DOUBLE_CONST", kind = "double constant", kind = "literal")] DOUBLE_CONST(f64), // Multi-char tokens /// << @@ -1601,13 +1601,13 @@ pub enum Token { USING, // Other /// Whitespaace - #[lang_util(display = "", as(display), kind = "trivia")] + #[lang_util(display = "", parser(display), kind = "trivia")] WS, /// Comment (single-line or multi-line) - #[lang_util(display = "", as(display), kind = "trivia")] + #[lang_util(display = "", parser(display), kind = "trivia")] COMMENT, /// Marker for invalid tokens - #[lang_util(display = "", as(display), kind = "error")] + #[lang_util(display = "", parser(display), kind = "error")] ERROR(ErrorKind), } diff --git a/lang-util-derive/Cargo.toml b/lang-util-derive/Cargo.toml index 293794df0..cd1c645c1 100644 --- a/lang-util-derive/Cargo.toml +++ b/lang-util-derive/Cargo.toml @@ -20,4 +20,4 @@ proc-macro = true darling = "0.20" proc-macro2 = "1.0" quote = "1.0" -syn = "1.0" +syn = "2.0" diff --git a/lang-util-derive/src/token.rs b/lang-util-derive/src/token.rs index 79e256b8a..e41b37a9a 100644 --- a/lang-util-derive/src/token.rs +++ b/lang-util-derive/src/token.rs @@ -3,7 +3,7 @@ use std::collections::HashMap; use darling::{FromDeriveInput, FromField, FromMeta, FromVariant}; use proc_macro2::{Span, TokenStream}; use quote::{format_ident, quote, quote_spanned}; -use syn::{parse_macro_input, spanned::Spanned, DeriveInput, Token}; +use syn::{parse_macro_input, spanned::Spanned, DeriveInput, LitStr, Token}; #[derive(FromField)] struct TokenVariantField { @@ -23,7 +23,7 @@ impl FromMeta for TokenDisplay { }) } - fn from_list(items: &[syn::NestedMeta]) -> darling::Result { + fn from_list(items: &[darling::ast::NestedMeta]) -> darling::Result { Ok(Self { format: String::from_nested_meta( items @@ -44,7 +44,7 @@ struct TokenAttr { } impl FromMeta for TokenAttr { - fn from_list(items: &[syn::NestedMeta]) -> darling::Result { + fn from_list(items: &[darling::ast::NestedMeta]) -> darling::Result { Ok(Self { token: String::from_nested_meta( items @@ -65,14 +65,14 @@ impl FromMeta for AsParser { Ok(Self::RawString(value.to_owned())) } - fn from_nested_meta(item: &syn::NestedMeta) -> darling::Result { + fn from_nested_meta(item: &darling::ast::NestedMeta) -> darling::Result { match item { - syn::NestedMeta::Meta(syn::Meta::Path(p)) => Ok(Self::Path(p.to_owned())), + darling::ast::NestedMeta::Meta(syn::Meta::Path(p)) => Ok(Self::Path(p.to_owned())), _ => Err(darling::Error::unsupported_format("meta")), } } - fn from_list(items: &[syn::NestedMeta]) -> darling::Result { + fn from_list(items: &[darling::ast::NestedMeta]) -> darling::Result { if let Some(item) = items.first() { return Self::from_nested_meta(item); } @@ -89,7 +89,7 @@ struct TokenVariant { attrs: Vec, #[darling(default)] display: Option, - #[darling(default, rename = "as")] + #[darling(default, rename = "parser")] as_parser: Option, #[darling(default, rename = "token")] fallback_token: Option, @@ -381,16 +381,17 @@ type TokenAttrTy<'s> = Option<(darling::Result, proc_macro2::Span)>; fn parse_token_attr(variant: &TokenVariant) -> TokenAttrTy { // Unit struct, is there a token impl? for attr in variant.attrs.iter() { - if attr - .path - .get_ident() - .map(|ident| ident == "token") - .unwrap_or(false) - { + if attr.path().is_ident("token") { return Some(( - attr.parse_meta() - .map_err(darling::Error::custom) - .and_then(|meta| TokenAttr::from_meta(&meta)), + if let Ok(result) = attr.parse_args::() { + Ok(TokenAttr { + token: result.value(), + }) + } else { + attr.parse_args() + .map_err(darling::Error::custom) + .and_then(|meta| TokenAttr::from_meta(&meta)) + }, attr.span(), )); } @@ -420,10 +421,10 @@ enum AsParserError { impl std::fmt::Display for AsParserError { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { - Self::MissingDisplayImpl => write!(f, "in lang_util attribute, `as = display` specified but not display implementation provided"), - Self::InvalidAs => write!(f, "invalid `as` value, expected display or a literal string"), + Self::MissingDisplayImpl => write!(f, "in lang_util attribute, `parser = display` specified but not display implementation provided"), + Self::InvalidAs => write!(f, "invalid `parser` value, expected display or a literal string"), Self::InvalidTokenAttribute(error) => write!(f, "invalid token attribute: {}", error), - Self::NoTokenOrAs => write!(f, "missing token or lang_util(as = \"...\") attributes"), + Self::NoTokenOrAs => write!(f, "missing token or lang_util(parser = \"...\") attributes"), } } } @@ -544,7 +545,10 @@ pub(crate) fn token(input: proc_macro::TokenStream) -> proc_macro::TokenStream { // Parse the input tokens into a syntax tree let input = parse_macro_input!(input as DeriveInput); // Find out enum-level options - TokenOpts::from_derive_input(&input).expect("failed to parse options") + match TokenOpts::from_derive_input(&input) { + Ok(res) => res, + Err(err) => return err.write_errors().into(), + } }; let base_ident = &opts.ident; From b0ccc3f2cee697e96a615c025a7c79e315f0e539 Mon Sep 17 00:00:00 2001 From: Alixinne Date: Mon, 19 Aug 2024 20:23:17 +0200 Subject: [PATCH 03/10] chore: fix clippy warnings --- lang-pp/src/lexer/glue/token.rs | 2 +- lang-pp/src/parser/syntax_kind.rs | 2 +- lang-pp/src/processor/nodes.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lang-pp/src/lexer/glue/token.rs b/lang-pp/src/lexer/glue/token.rs index a5c62e991..438579b48 100644 --- a/lang-pp/src/lexer/glue/token.rs +++ b/lang-pp/src/lexer/glue/token.rs @@ -132,6 +132,6 @@ impl Token { impl From for Token { fn from(pre: crate::lexer::PreToken) -> Self { // SAFETY: Token is a superset of PreToken - unsafe { std::mem::transmute(std::mem::transmute::<_, u16>(pre)) } + unsafe { std::mem::transmute(std::mem::transmute::(pre)) } } } diff --git a/lang-pp/src/parser/syntax_kind.rs b/lang-pp/src/parser/syntax_kind.rs index b8b4dd89c..296656dc7 100644 --- a/lang-pp/src/parser/syntax_kind.rs +++ b/lang-pp/src/parser/syntax_kind.rs @@ -287,7 +287,7 @@ impl From for SyntaxKind { } // SAFETY: Aside from LINECONT, SyntaxKind is a superset of lexer::Token - unsafe { std::mem::transmute(std::mem::transmute::<_, u16>(s)) } + unsafe { std::mem::transmute(std::mem::transmute::(s)) } } } diff --git a/lang-pp/src/processor/nodes.rs b/lang-pp/src/processor/nodes.rs index 5d37d7ae4..8d902e20f 100644 --- a/lang-pp/src/processor/nodes.rs +++ b/lang-pp/src/processor/nodes.rs @@ -461,7 +461,7 @@ impl TryFrom<(FileId, SyntaxNode)> for Extension { .collect(); let name = idents - .get(0) + .first() .ok_or(Self::Error::MissingExtensionName) .map(|name| ExtensionName::new(Unescaped::new(name.text()).to_string()))?; From 0315528651d69d500986748ddbbdc34c55510ab0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 12 Aug 2024 02:26:19 +0000 Subject: [PATCH 04/10] fix(deps): update rust crate derive_more to v1 --- lang-pp/Cargo.toml | 2 +- lang-pp/src/types/token.rs | 330 ++++++++++++++++++------------------ lang-pp/tests/common/mod.rs | 8 +- lang-util-dev/Cargo.toml | 2 +- lang-util/Cargo.toml | 2 +- lang/tests/common/mod.rs | 6 +- 6 files changed, 175 insertions(+), 175 deletions(-) diff --git a/lang-pp/Cargo.toml b/lang-pp/Cargo.toml index adf5ceb27..3ea51579e 100644 --- a/lang-pp/Cargo.toml +++ b/lang-pp/Cargo.toml @@ -19,7 +19,7 @@ lang-util = "=0.5.3" string_cache = "0.8" thiserror = "1.0" arrayvec = "0.7" -derive_more = "0.99" +derive_more = { version = "1.0", features = ["display"] } # Preprocessor rowan = { version = "0.15", optional = true } diff --git a/lang-pp/src/types/token.rs b/lang-pp/src/types/token.rs index 7041d7476..56875d654 100644 --- a/lang-pp/src/types/token.rs +++ b/lang-pp/src/types/token.rs @@ -11,485 +11,485 @@ use super::{ #[allow(non_camel_case_types)] pub enum TypeName { /// "void" - #[display(fmt = "void")] + #[display("void")] VOID, /// "int" - #[display(fmt = "int")] + #[display("int")] INT, /// "bool" - #[display(fmt = "bool")] + #[display("bool")] BOOL, /// "float" - #[display(fmt = "float")] + #[display("float")] FLOAT, /// "double" - #[display(fmt = "double")] + #[display("double")] DOUBLE, /// "vec2" - #[display(fmt = "vec2")] + #[display("vec2")] VEC2, /// "vec3" - #[display(fmt = "vec3")] + #[display("vec3")] VEC3, /// "vec4" - #[display(fmt = "vec4")] + #[display("vec4")] VEC4, /// "ivec2" - #[display(fmt = "ivec2")] + #[display("ivec2")] IVEC2, /// "ivec3" - #[display(fmt = "ivec3")] + #[display("ivec3")] IVEC3, /// "ivec4" - #[display(fmt = "ivec4")] + #[display("ivec4")] IVEC4, /// "bvec2" - #[display(fmt = "bvec2")] + #[display("bvec2")] BVEC2, /// "bvec3" - #[display(fmt = "bvec3")] + #[display("bvec3")] BVEC3, /// "bvec4" - #[display(fmt = "bvec4")] + #[display("bvec4")] BVEC4, /// "uint" - #[display(fmt = "uint")] + #[display("uint")] UINT, /// "atomic_uint" - #[display(fmt = "atomic_uint")] + #[display("atomic_uint")] ATOMIC_UINT, /// "uvec2" - #[display(fmt = "uvec2")] + #[display("uvec2")] UVEC2, /// "uvec3" - #[display(fmt = "uvec3")] + #[display("uvec3")] UVEC3, /// "uvec4" - #[display(fmt = "uvec4")] + #[display("uvec4")] UVEC4, /// "dvec2" - #[display(fmt = "dvec2")] + #[display("dvec2")] DVEC2, /// "dvec3" - #[display(fmt = "dvec3")] + #[display("dvec3")] DVEC3, /// "dvec4" - #[display(fmt = "dvec4")] + #[display("dvec4")] DVEC4, /// "mat2" - #[display(fmt = "mat2")] + #[display("mat2")] MAT2, /// "mat3" - #[display(fmt = "mat3")] + #[display("mat3")] MAT3, /// "mat4" - #[display(fmt = "mat4")] + #[display("mat4")] MAT4, /// "mat2x2" - #[display(fmt = "mat2x2")] + #[display("mat2x2")] MAT2X2, /// "mat2x3" - #[display(fmt = "mat2x3")] + #[display("mat2x3")] MAT2X3, /// "mat2x4" - #[display(fmt = "mat2x4")] + #[display("mat2x4")] MAT2X4, /// "mat3x2" - #[display(fmt = "mat3x2")] + #[display("mat3x2")] MAT3X2, /// "mat3x3" - #[display(fmt = "mat3x3")] + #[display("mat3x3")] MAT3X3, /// "mat3x4" - #[display(fmt = "mat3x4")] + #[display("mat3x4")] MAT3X4, /// "mat4x2" - #[display(fmt = "mat4x2")] + #[display("mat4x2")] MAT4X2, /// "mat4x3" - #[display(fmt = "mat4x3")] + #[display("mat4x3")] MAT4X3, /// "mat4x4" - #[display(fmt = "mat4x4")] + #[display("mat4x4")] MAT4X4, /// "dmat2" - #[display(fmt = "dmat2")] + #[display("dmat2")] DMAT2, /// "dmat3" - #[display(fmt = "dmat3")] + #[display("dmat3")] DMAT3, /// "dmat4" - #[display(fmt = "dmat4")] + #[display("dmat4")] DMAT4, /// "dmat2x2" - #[display(fmt = "dmat2x2")] + #[display("dmat2x2")] DMAT2X2, /// "dmat2x3" - #[display(fmt = "dmat2x3")] + #[display("dmat2x3")] DMAT2X3, /// "dmat2x4" - #[display(fmt = "dmat2x4")] + #[display("dmat2x4")] DMAT2X4, /// "dmat3x2" - #[display(fmt = "dmat3x2")] + #[display("dmat3x2")] DMAT3X2, /// "dmat3x3" - #[display(fmt = "dmat3x3")] + #[display("dmat3x3")] DMAT3X3, /// "dmat3x4" - #[display(fmt = "dmat3x4")] + #[display("dmat3x4")] DMAT3X4, /// "dmat4x2" - #[display(fmt = "dmat4x2")] + #[display("dmat4x2")] DMAT4X2, /// "dmat4x3" - #[display(fmt = "dmat4x3")] + #[display("dmat4x3")] DMAT4X3, /// "dmat4x4" - #[display(fmt = "dmat4x4")] + #[display("dmat4x4")] DMAT4X4, /// "sampler1D" - #[display(fmt = "sampler1D")] + #[display("sampler1D")] SAMPLER1D, /// "sampler1DShadow" - #[display(fmt = "sampler1DShadow")] + #[display("sampler1DShadow")] SAMPLER1DSHADOW, /// "sampler1DArray" - #[display(fmt = "sampler1DArray")] + #[display("sampler1DArray")] SAMPLER1DARRAY, /// "sampler1DArrayShadow" - #[display(fmt = "sampler1DArrayShadow")] + #[display("sampler1DArrayShadow")] SAMPLER1DARRAYSHADOW, /// "isampler1D" - #[display(fmt = "isampler1D")] + #[display("isampler1D")] ISAMPLER1D, /// "isampler1DArray" - #[display(fmt = "isampler1DArray")] + #[display("isampler1DArray")] ISAMPLER1DARRAY, /// "usampler1D" - #[display(fmt = "usampler1D")] + #[display("usampler1D")] USAMPLER1D, /// "usampler1DArray" - #[display(fmt = "usampler1DArray")] + #[display("usampler1DArray")] USAMPLER1DARRAY, /// "sampler2D" - #[display(fmt = "sampler2D")] + #[display("sampler2D")] SAMPLER2D, /// "sampler2DShadow" - #[display(fmt = "sampler2DShadow")] + #[display("sampler2DShadow")] SAMPLER2DSHADOW, /// "sampler2DArray" - #[display(fmt = "sampler2DArray")] + #[display("sampler2DArray")] SAMPLER2DARRAY, /// "sampler2DArrayShadow" - #[display(fmt = "sampler2DArrayShadow")] + #[display("sampler2DArrayShadow")] SAMPLER2DARRAYSHADOW, /// "isampler2D" - #[display(fmt = "isampler2D")] + #[display("isampler2D")] ISAMPLER2D, /// "isampler2DArray" - #[display(fmt = "isampler2DArray")] + #[display("isampler2DArray")] ISAMPLER2DARRAY, /// "usampler2D" - #[display(fmt = "usampler2D")] + #[display("usampler2D")] USAMPLER2D, /// "usampler2DArray" - #[display(fmt = "usampler2DArray")] + #[display("usampler2DArray")] USAMPLER2DARRAY, /// "sampler2DRect" - #[display(fmt = "sampler2DRect")] + #[display("sampler2DRect")] SAMPLER2DRECT, /// "sampler2DRectShadow" - #[display(fmt = "sampler2DRectShadow")] + #[display("sampler2DRectShadow")] SAMPLER2DRECTSHADOW, /// "isampler2DRect" - #[display(fmt = "isampler2DRect")] + #[display("isampler2DRect")] ISAMPLER2DRECT, /// "usampler2DRect" - #[display(fmt = "usampler2DRect")] + #[display("usampler2DRect")] USAMPLER2DRECT, /// "sampler2DMS" - #[display(fmt = "sampler2DMS")] + #[display("sampler2DMS")] SAMPLER2DMS, /// "isampler2DMS" - #[display(fmt = "isampler2DMS")] + #[display("isampler2DMS")] ISAMPLER2DMS, /// "usampler2DMS" - #[display(fmt = "usampler2DMS")] + #[display("usampler2DMS")] USAMPLER2DMS, /// "sampler2DMSArray" - #[display(fmt = "sampler2DMSArray")] + #[display("sampler2DMSArray")] SAMPLER2DMSARRAY, /// "isampler2DMSArray" - #[display(fmt = "isampler2DMSArray")] + #[display("isampler2DMSArray")] ISAMPLER2DMSARRAY, /// "usampler2DMSArray" - #[display(fmt = "usampler2DMSArray")] + #[display("usampler2DMSArray")] USAMPLER2DMSARRAY, /// "sampler3D" - #[display(fmt = "sampler3D")] + #[display("sampler3D")] SAMPLER3D, /// "isampler3D" - #[display(fmt = "isampler3D")] + #[display("isampler3D")] ISAMPLER3D, /// "usampler3D" - #[display(fmt = "usampler3D")] + #[display("usampler3D")] USAMPLER3D, /// "samplerCube" - #[display(fmt = "samplerCube")] + #[display("samplerCube")] SAMPLERCUBE, /// "samplerCubeShadow" - #[display(fmt = "samplerCubeShadow")] + #[display("samplerCubeShadow")] SAMPLERCUBESHADOW, /// "isamplerCube" - #[display(fmt = "isamplerCube")] + #[display("isamplerCube")] ISAMPLERCUBE, /// "usamplerCube" - #[display(fmt = "usamplerCube")] + #[display("usamplerCube")] USAMPLERCUBE, /// "samplerCubeArray" - #[display(fmt = "samplerCubeArray")] + #[display("samplerCubeArray")] SAMPLERCUBEARRAY, /// "samplerCubeArrayShadow" - #[display(fmt = "samplerCubeArrayShadow")] + #[display("samplerCubeArrayShadow")] SAMPLERCUBEARRAYSHADOW, /// "isamplerCubeArray" - #[display(fmt = "isamplerCubeArray")] + #[display("isamplerCubeArray")] ISAMPLERCUBEARRAY, /// "usamplerCubeArray" - #[display(fmt = "usamplerCubeArray")] + #[display("usamplerCubeArray")] USAMPLERCUBEARRAY, /// "samplerBuffer" - #[display(fmt = "samplerBuffer")] + #[display("samplerBuffer")] SAMPLERBUFFER, /// "isamplerBuffer" - #[display(fmt = "isamplerBuffer")] + #[display("isamplerBuffer")] ISAMPLERBUFFER, /// "usamplerBuffer" - #[display(fmt = "usamplerBuffer")] + #[display("usamplerBuffer")] USAMPLERBUFFER, /// "image1D" - #[display(fmt = "image1D")] + #[display("image1D")] IMAGE1D, /// "iimage1D" - #[display(fmt = "iimage1D")] + #[display("iimage1D")] IIMAGE1D, /// "uimage1D" - #[display(fmt = "uimage1D")] + #[display("uimage1D")] UIMAGE1D, /// "image1DArray" - #[display(fmt = "image1DArray")] + #[display("image1DArray")] IMAGE1DARRAY, /// "iimage1DArray" - #[display(fmt = "iimage1DArray")] + #[display("iimage1DArray")] IIMAGE1DARRAY, /// "uimage1DArray" - #[display(fmt = "uimage1DArray")] + #[display("uimage1DArray")] UIMAGE1DARRAY, /// "image2D" - #[display(fmt = "image2D")] + #[display("image2D")] IMAGE2D, /// "iimage2D" - #[display(fmt = "iimage2D")] + #[display("iimage2D")] IIMAGE2D, /// "uimage2D" - #[display(fmt = "uimage2D")] + #[display("uimage2D")] UIMAGE2D, /// "image2DArray" - #[display(fmt = "image2DArray")] + #[display("image2DArray")] IMAGE2DARRAY, /// "iimage2DArray" - #[display(fmt = "iimage2DArray")] + #[display("iimage2DArray")] IIMAGE2DARRAY, /// "uimage2DArray" - #[display(fmt = "uimage2DArray")] + #[display("uimage2DArray")] UIMAGE2DARRAY, /// "image2DRect" - #[display(fmt = "image2DRect")] + #[display("image2DRect")] IMAGE2DRECT, /// "iimage2DRect" - #[display(fmt = "iimage2DRect")] + #[display("iimage2DRect")] IIMAGE2DRECT, /// "uimage2DRect" - #[display(fmt = "uimage2DRect")] + #[display("uimage2DRect")] UIMAGE2DRECT, /// "image2DMS" - #[display(fmt = "image2DMS")] + #[display("image2DMS")] IMAGE2DMS, /// "iimage2DMS" - #[display(fmt = "iimage2DMS")] + #[display("iimage2DMS")] IIMAGE2DMS, /// "uimage2DMS" - #[display(fmt = "uimage2DMS")] + #[display("uimage2DMS")] UIMAGE2DMS, /// "image2DMSArray" - #[display(fmt = "image2DMSArray")] + #[display("image2DMSArray")] IMAGE2DMSARRAY, /// "iimage2DMSArray" - #[display(fmt = "iimage2DMSArray")] + #[display("iimage2DMSArray")] IIMAGE2DMSARRAY, /// "uimage2DMSArray" - #[display(fmt = "uimage2DMSArray")] + #[display("uimage2DMSArray")] UIMAGE2DMSARRAY, /// "image3D" - #[display(fmt = "image3D")] + #[display("image3D")] IMAGE3D, /// "iimage3D" - #[display(fmt = "iimage3D")] + #[display("iimage3D")] IIMAGE3D, /// "uimage3D" - #[display(fmt = "uimage3D")] + #[display("uimage3D")] UIMAGE3D, /// "imageCube" - #[display(fmt = "imageCube")] + #[display("imageCube")] IMAGECUBE, /// "iimageCube" - #[display(fmt = "iimageCube")] + #[display("iimageCube")] IIMAGECUBE, /// "uimageCube" - #[display(fmt = "uimageCube")] + #[display("uimageCube")] UIMAGECUBE, /// "imageCubeArray" - #[display(fmt = "imageCubeArray")] + #[display("imageCubeArray")] IMAGECUBEARRAY, /// "iimageCubeArray" - #[display(fmt = "iimageCubeArray")] + #[display("iimageCubeArray")] IIMAGECUBEARRAY, /// "uimageCubeArray" - #[display(fmt = "uimageCubeArray")] + #[display("uimageCubeArray")] UIMAGECUBEARRAY, /// "imageBuffer" - #[display(fmt = "imageBuffer")] + #[display("imageBuffer")] IMAGEBUFFER, /// "iimageBuffer" - #[display(fmt = "iimageBuffer")] + #[display("iimageBuffer")] IIMAGEBUFFER, /// "uimageBuffer" - #[display(fmt = "uimageBuffer")] + #[display("uimageBuffer")] UIMAGEBUFFER, // Vulkan type names /// "texture1D" - #[display(fmt = "texture1D")] + #[display("texture1D")] TEXTURE1D, /// "texture1DArray" - #[display(fmt = "texture1DArray")] + #[display("texture1DArray")] TEXTURE1DARRAY, /// "itexture1D" - #[display(fmt = "itexture1D")] + #[display("itexture1D")] ITEXTURE1D, /// "itexture1DArray" - #[display(fmt = "itexture1DArray")] + #[display("itexture1DArray")] ITEXTURE1DARRAY, /// "utexture1D" - #[display(fmt = "utexture1D")] + #[display("utexture1D")] UTEXTURE1D, /// "utexture1DArray" - #[display(fmt = "utexture1DArray")] + #[display("utexture1DArray")] UTEXTURE1DARRAY, /// "texture2D" - #[display(fmt = "texture2D")] + #[display("texture2D")] TEXTURE2D, /// "texture2DArray" - #[display(fmt = "texture2DArray")] + #[display("texture2DArray")] TEXTURE2DARRAY, /// "itexture2D" - #[display(fmt = "itexture2D")] + #[display("itexture2D")] ITEXTURE2D, /// "itexture2DArray" - #[display(fmt = "itexture2DArray")] + #[display("itexture2DArray")] ITEXTURE2DARRAY, /// "utexture2D" - #[display(fmt = "utexture2D")] + #[display("utexture2D")] UTEXTURE2D, /// "utexture2DArray" - #[display(fmt = "utexture2DArray")] + #[display("utexture2DArray")] UTEXTURE2DARRAY, /// "texture2DRect" - #[display(fmt = "texture2DRect")] + #[display("texture2DRect")] TEXTURE2DRECT, /// "itexture2DRect" - #[display(fmt = "itexture2DRect")] + #[display("itexture2DRect")] ITEXTURE2DRECT, /// "utexture2DRect" - #[display(fmt = "utexture2DRect")] + #[display("utexture2DRect")] UTEXTURE2DRECT, /// "texture2DMS" - #[display(fmt = "texture2DMS")] + #[display("texture2DMS")] TEXTURE2DMS, /// "itexture2DMS" - #[display(fmt = "itexture2DMS")] + #[display("itexture2DMS")] ITEXTURE2DMS, /// "utexture2DMS" - #[display(fmt = "utexture2DMS")] + #[display("utexture2DMS")] UTEXTURE2DMS, /// "texture2DMSArray" - #[display(fmt = "texture2DMSArray")] + #[display("texture2DMSArray")] TEXTURE2DMSARRAY, /// "itexture2DMSArray" - #[display(fmt = "itexture2DMSArray")] + #[display("itexture2DMSArray")] ITEXTURE2DMSARRAY, /// "utexture2DMSArray" - #[display(fmt = "utexture2DMSArray")] + #[display("utexture2DMSArray")] UTEXTURE2DMSARRAY, /// "texture3D" - #[display(fmt = "texture3D")] + #[display("texture3D")] TEXTURE3D, /// "itexture3D" - #[display(fmt = "itexture3D")] + #[display("itexture3D")] ITEXTURE3D, /// "utexture3D" - #[display(fmt = "utexture3D")] + #[display("utexture3D")] UTEXTURE3D, /// "textureCube" - #[display(fmt = "textureCube")] + #[display("textureCube")] TEXTURECUBE, /// "itextureCube" - #[display(fmt = "itextureCube")] + #[display("itextureCube")] ITEXTURECUBE, /// "utextureCube" - #[display(fmt = "utextureCube")] + #[display("utextureCube")] UTEXTURECUBE, /// "textureCubeArray" - #[display(fmt = "textureCubeArray")] + #[display("textureCubeArray")] TEXTURECUBEARRAY, /// "itextureCubeArray" - #[display(fmt = "itextureCubeArray")] + #[display("itextureCubeArray")] ITEXTURECUBEARRAY, /// "utextureCubeArray" - #[display(fmt = "utextureCubeArray")] + #[display("utextureCubeArray")] UTEXTURECUBEARRAY, /// "textureBuffer" - #[display(fmt = "textureBuffer")] + #[display("textureBuffer")] TEXTUREBUFFER, /// "itextureBuffer" - #[display(fmt = "itextureBuffer")] + #[display("itextureBuffer")] ITEXTUREBUFFER, /// "utextureBuffer" - #[display(fmt = "utextureBuffer")] + #[display("utextureBuffer")] UTEXTUREBUFFER, /// "sampler" - #[display(fmt = "sampler")] + #[display("sampler")] SAMPLER, /// "samplerShadow" - #[display(fmt = "samplerShadow")] + #[display("samplerShadow")] SAMPLERSHADOW, /// "subpassInput" - #[display(fmt = "subpassInput")] + #[display("subpassInput")] SUBPASSINPUT, /// "isubpassInput" - #[display(fmt = "isubpassInput")] + #[display("isubpassInput")] ISUBPASSINPUT, /// "usubpassInput" - #[display(fmt = "usubpassInput")] + #[display("usubpassInput")] USUBPASSINPUT, /// "subpassInputMS" - #[display(fmt = "subpassInputMS")] + #[display("subpassInputMS")] SUBPASSINPUTMS, /// "isubpassInputMS" - #[display(fmt = "isubpassInputMS")] + #[display("isubpassInputMS")] ISUBPASSINPUTMS, /// "usubpassInputMS" - #[display(fmt = "usubpassInputMS")] + #[display("usubpassInputMS")] USUBPASSINPUTMS, /// Reserved for future use RESERVED(TypeNameAtom), @@ -1613,15 +1613,15 @@ pub enum Token { #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, derive_more::Display)] pub enum ErrorKind { - #[display(fmt = "invalid token")] + #[display("invalid token")] InvalidToken, - #[display(fmt = "invalid int literal")] + #[display("invalid int literal")] InvalidIntLiteral, - #[display(fmt = "invalid uint literal")] + #[display("invalid uint literal")] InvalidUIntLiteral, - #[display(fmt = "invalid float literal")] + #[display("invalid float literal")] InvalidFloatLiteral, - #[display(fmt = "invalid double literal")] + #[display("invalid double literal")] InvalidDoubleLiteral, } diff --git a/lang-pp/tests/common/mod.rs b/lang-pp/tests/common/mod.rs index b51b3cc2e..29a8c0d2e 100644 --- a/lang-pp/tests/common/mod.rs +++ b/lang-pp/tests/common/mod.rs @@ -9,13 +9,13 @@ use lang_util_dev::test_util::PathKey; #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, lang_util_dev::Display)] enum Output { - #[display(fmt = "parsed")] + #[display("parsed")] Parsed, - #[display(fmt = "events")] + #[display("events")] Events, - #[display(fmt = "pp")] + #[display("pp")] Preprocessed, - #[display(fmt = "errors")] + #[display("errors")] Errors, } diff --git a/lang-util-dev/Cargo.toml b/lang-util-dev/Cargo.toml index bc7678c04..68f5564d4 100644 --- a/lang-util-dev/Cargo.toml +++ b/lang-util-dev/Cargo.toml @@ -13,5 +13,5 @@ keywords = ["language", "parser", "ast"] categories = ["parsing"] [dependencies] -derive_more = "0.99" +derive_more = { version = "1.0", features = ["display"] } similar-asserts = "1.4" diff --git a/lang-util/Cargo.toml b/lang-util/Cargo.toml index 7a89a4b9f..5bf6d72cd 100644 --- a/lang-util/Cargo.toml +++ b/lang-util/Cargo.toml @@ -17,7 +17,7 @@ lang-util-derive = "=0.5.3" line-span = "0.1" smol_str = "0.2" text-size = "1.1" -derive_more = "0.99" +derive_more = { version = "1.0", features = ["display", "from"] } # lalrpop dependencies lalrpop-util = { version = "0.20.0", default-features = false, optional = true } diff --git a/lang/tests/common/mod.rs b/lang/tests/common/mod.rs index 314a7e699..4c07ee781 100644 --- a/lang/tests/common/mod.rs +++ b/lang/tests/common/mod.rs @@ -12,13 +12,13 @@ enum Output { not(feature = "lexer-v2-min"), not(feature = "lexer-v2-full") ), - display(fmt = "ast-v1") + display("ast-v1") )] #[cfg_attr( all(feature = "lexer-v2-min", not(feature = "lexer-v2-full")), - display(fmt = "ast-v1") + display("ast-v1") )] - #[cfg_attr(feature = "lexer-v2-full", display(fmt = "ast-v2-full"))] + #[cfg_attr(feature = "lexer-v2-full", display("ast-v2-full"))] Ast, } From d746dcf11a257e96ba0f7bfaf4c612bb4b556186 Mon Sep 17 00:00:00 2001 From: Alixinne Date: Mon, 19 Aug 2024 22:06:44 +0200 Subject: [PATCH 05/10] chore: fix script headers --- ci/bumpver.sh | 2 +- ci/readme.sh | 2 +- ci/release.sh | 2 +- data/validate-shaders.sh | 2 +- fuzz/fuzz.sh | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ci/bumpver.sh b/ci/bumpver.sh index 23ebe3176..12f872f6d 100755 --- a/ci/bumpver.sh +++ b/ci/bumpver.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -eux diff --git a/ci/readme.sh b/ci/readme.sh index 47307ecd3..aaf062b61 100755 --- a/ci/readme.sh +++ b/ci/readme.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash CHECK_MODE=0 diff --git a/ci/release.sh b/ci/release.sh index ddbc691ae..1157167ab 100755 --- a/ci/release.sh +++ b/ci/release.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -e diff --git a/data/validate-shaders.sh b/data/validate-shaders.sh index 89dc95566..cb738332b 100755 --- a/data/validate-shaders.sh +++ b/data/validate-shaders.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # This script validates shaders (if successfully compiled) using spirv-val. # It is not meant to preclude the possible addition of the validator to diff --git a/fuzz/fuzz.sh b/fuzz/fuzz.sh index fbf9623ff..14bbfb10e 100755 --- a/fuzz/fuzz.sh +++ b/fuzz/fuzz.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail From 8a47fde1090dae673bf7ad226af7817c06122396 Mon Sep 17 00:00:00 2001 From: Alixinne Date: Mon, 19 Aug 2024 22:11:21 +0200 Subject: [PATCH 06/10] chore(cog): allow releases on next branch --- cog.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/cog.toml b/cog.toml index fc789a315..b66cfab8e 100644 --- a/cog.toml +++ b/cog.toml @@ -1,6 +1,7 @@ ignore_merge_commits = true branch_whitelist = [ "master", + "next", ] pre_bump_hooks = [ "./ci/bumpver.sh {{version}}", From 9cbd40203e90f05359bfa784453cb7e296ed91a9 Mon Sep 17 00:00:00 2001 From: Alixinne Date: Mon, 19 Aug 2024 22:13:24 +0200 Subject: [PATCH 07/10] chore(version): v0.6.0-beta.1 [skip ci] --- CHANGELOG.md | 27 +++++++++++++++++++++++++++ lang-cli/Cargo.toml | 8 ++++---- lang-lexer/Cargo.toml | 8 ++++---- lang-pp/Cargo.toml | 4 ++-- lang-quote/Cargo.toml | 4 ++-- lang-types/Cargo.toml | 4 ++-- lang-util-derive/Cargo.toml | 2 +- lang-util-dev/Cargo.toml | 2 +- lang-util/Cargo.toml | 4 ++-- lang/Cargo.toml | 10 +++++----- xtask/Cargo.toml | 2 +- 11 files changed, 51 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e203ffaf2..f5f98e131 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,33 @@ ## [Unreleased] - - - +## v0.6.0-beta.1 - 2024-08-19 +#### Bug Fixes +- **(deps)** update rust crate derive_more to v1 - (0315528) - renovate[bot] +- **(deps)** update all non-major dependencies - (65b144f) - renovate[bot] +- **(glsl-lang-quote)** correctly parse #(ident) at line start - (c47f7fc) - *alixinne* +- update github profile information - (2beea1f) - Alix Tavernier +#### Build system +- set resolver to 2 - (73544c2) - alixinne +#### Features +- rename lang_util(as) to lang_util(parser) - (1902047) - alixinne +#### Miscellaneous Chores +- **(cog)** allow releases on next branch - (8a47fde) - *alixinne* +- **(deps)** update softprops/action-gh-release action to v2 - (2c27d68) - renovate[bot] +- **(deps)** update peaceiris/actions-gh-pages action to v4 - (37d2da5) - renovate[bot] +- **(deps)** update rust crate glsl to v7 - (e8782ee) - renovate[bot] +- **(deps)** update actions/cache action to v4 - (76c7bd2) - renovate[bot] +- **(deps)** update actions/checkout action to v4 - (be49ea6) - renovate[bot] +- **(deps)** update actions/cache action to v3 - (b159bfb) - renovate[bot] +- **(version)** v0.5.3 [skip ci] - (ef30eef) - glsl-lang +- **(version)** v0.5.2 [skip ci] - (c0ada55) - glsl-lang +- fix script headers - (d746dcf) - alixinne +- fix clippy warnings - (b0ccc3f) - alixinne +- fix clippy warnings - (c28f583) - alixinne +- bump rust version to 1.74.0 - (23a3c9b) - alixinne + +- - - + ## v0.5.3 - 2024-07-23 #### Bug Fixes - **(glsl-lang-quote)** correctly parse #(ident) at line start - (c47f7fc) - *alixinne* diff --git a/lang-cli/Cargo.toml b/lang-cli/Cargo.toml index cbf269c20..331a1c79e 100644 --- a/lang-cli/Cargo.toml +++ b/lang-cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "glsl-lang-cli" -version = "0.5.3" +version = "0.6.0-beta.1" 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.5.3", features = ["lexer-v2-full"] } -glsl-lang-pp = { version = "=0.5.3" } -lang-util = "=0.5.3" +glsl-lang = { version = "=0.6.0-beta.1", features = ["lexer-v2-full"] } +glsl-lang-pp = { version = "=0.6.0-beta.1" } +lang-util = "=0.6.0-beta.1" argh = "0.1" serde_json = { version = "1.0", optional = true } diff --git a/lang-lexer/Cargo.toml b/lang-lexer/Cargo.toml index acbb70b26..7d1842489 100644 --- a/lang-lexer/Cargo.toml +++ b/lang-lexer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "glsl-lang-lexer" -version = "0.5.3" +version = "0.6.0-beta.1" 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.5.3" -lang-util = { version = "=0.5.3", features = ["lalrpop"] } +glsl-lang-types = "=0.6.0-beta.1" +lang-util = { version = "=0.6.0-beta.1", 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.5.3", optional = true } +glsl-lang-pp = { version = "=0.6.0-beta.1", 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 3ea51579e..1e41205a9 100644 --- a/lang-pp/Cargo.toml +++ b/lang-pp/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "glsl-lang-pp" -version = "0.5.3" +version = "0.6.0-beta.1" authors = ["Alixinne "] edition = "2021" license = "BSD-3-Clause" @@ -14,7 +14,7 @@ categories = ["parser-implementations", "rendering"] build = "build.rs" [dependencies] -lang-util = "=0.5.3" +lang-util = "=0.6.0-beta.1" string_cache = "0.8" thiserror = "1.0" diff --git a/lang-quote/Cargo.toml b/lang-quote/Cargo.toml index 53e3b02ed..144a685d2 100644 --- a/lang-quote/Cargo.toml +++ b/lang-quote/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "glsl-lang-quote" -version = "0.5.3" +version = "0.6.0-beta.1" authors = ["Alixinne "] edition = "2021" license = "BSD-3-Clause" @@ -17,7 +17,7 @@ proc-macro = true path = "src/lib.rs" [dependencies] -glsl-lang = { version = "=0.5.3", default-features = false, features = ["lexer-v2-full"] } +glsl-lang = { version = "=0.6.0-beta.1", default-features = false, features = ["lexer-v2-full"] } proc-macro2 = "1" quote = "1" diff --git a/lang-types/Cargo.toml b/lang-types/Cargo.toml index ef5d7d24a..b4e74512b 100644 --- a/lang-types/Cargo.toml +++ b/lang-types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "glsl-lang-types" -version = "0.5.3" +version = "0.6.0-beta.1" authors = ["Alixinne "] edition = "2021" license = "BSD-3-Clause" @@ -13,7 +13,7 @@ keywords = ["glsl", "language", "parser"] categories = ["rendering"] [dependencies] -lang-util = "=0.5.3" +lang-util = "=0.6.0-beta.1" thiserror = "1.0" rserde = { version = "1.0", optional = true, features = ["derive"], package = "serde" } diff --git a/lang-util-derive/Cargo.toml b/lang-util-derive/Cargo.toml index cd1c645c1..b10c2abba 100644 --- a/lang-util-derive/Cargo.toml +++ b/lang-util-derive/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lang-util-derive" -version = "0.5.3" +version = "0.6.0-beta.1" authors = ["Alixinne "] edition = "2021" license = "BSD-3-Clause" diff --git a/lang-util-dev/Cargo.toml b/lang-util-dev/Cargo.toml index 68f5564d4..ea1bfe17e 100644 --- a/lang-util-dev/Cargo.toml +++ b/lang-util-dev/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lang-util-dev" -version = "0.5.3" +version = "0.6.0-beta.1" authors = ["Alixinne "] edition = "2021" license = "BSD-3-Clause" diff --git a/lang-util/Cargo.toml b/lang-util/Cargo.toml index 5bf6d72cd..a95756fe2 100644 --- a/lang-util/Cargo.toml +++ b/lang-util/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lang-util" -version = "0.5.3" +version = "0.6.0-beta.1" authors = ["Alixinne "] edition = "2021" license = "BSD-3-Clause" @@ -13,7 +13,7 @@ keywords = ["language", "parser", "ast"] categories = ["parsing"] [dependencies] -lang-util-derive = "=0.5.3" +lang-util-derive = "=0.6.0-beta.1" line-span = "0.1" smol_str = "0.2" text-size = "1.1" diff --git a/lang/Cargo.toml b/lang/Cargo.toml index 9c44192e0..68e77186e 100644 --- a/lang/Cargo.toml +++ b/lang/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "glsl-lang" -version = "0.5.3" +version = "0.6.0-beta.1" 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.5.3", features = ["lalrpop"] } -glsl-lang-pp = { version = "=0.5.3", optional = true } -glsl-lang-lexer = { version = "=0.5.3", features = ["lalrpop"] } -glsl-lang-types = "=0.5.3" +lang-util = { version = "=0.6.0-beta.1", features = ["lalrpop"] } +glsl-lang-pp = { version = "=0.6.0-beta.1", optional = true } +glsl-lang-lexer = { version = "=0.6.0-beta.1", features = ["lalrpop"] } +glsl-lang-types = "=0.6.0-beta.1" rserde = { version = "1.0", optional = true, features = ["derive"], package = "serde" } diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml index 989517935..f6f7f28e2 100644 --- a/xtask/Cargo.toml +++ b/xtask/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "xtask" -version = "0.5.3" +version = "0.6.0-beta.1" edition = "2021" [dependencies] From 653ffd93042e72012013d55d286144d7ebf1128d Mon Sep 17 00:00:00 2001 From: Alixinne Date: Mon, 19 Aug 2024 23:34:46 +0200 Subject: [PATCH 08/10] chore: add deprecation notice for v1 lexer --- lang-lexer/src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lang-lexer/src/lib.rs b/lang-lexer/src/lib.rs index 27b6e7eeb..fd871f0b2 100644 --- a/lang-lexer/src/lib.rs +++ b/lang-lexer/src/lib.rs @@ -6,6 +6,10 @@ use lang_util::position::LexerPosition; pub use token::*; #[cfg(feature = "v1")] +#[deprecated( + since = "0.6.0", + note = "the v1 lexer is not spec-compliant and relies on outdated dependencies. It will be removed in glsl-lang 0.7.0" +)] pub mod v1; #[cfg(any(feature = "v2-min", feature = "v2-full"))] From 7d74c9b58dc95d73cdea59f5d43dc8f1d4a2d2e6 Mon Sep 17 00:00:00 2001 From: Alixinne Date: Mon, 19 Aug 2024 23:55:03 +0200 Subject: [PATCH 09/10] chore: manually bump dev-dependencies --- lang-pp/Cargo.toml | 2 +- lang/Cargo.toml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lang-pp/Cargo.toml b/lang-pp/Cargo.toml index 1e41205a9..c41577212 100644 --- a/lang-pp/Cargo.toml +++ b/lang-pp/Cargo.toml @@ -32,7 +32,7 @@ itertools = { version = "0.13", optional = true } once_cell = { version = "1.17.1", optional = true } [dev-dependencies] -lang-util-dev = "=0.5.3" +lang-util-dev = "=0.6.0-beta.1" expect-test = "1.3" encoding_rs = "0.8" diff --git a/lang/Cargo.toml b/lang/Cargo.toml index 68e77186e..06d5dc55b 100644 --- a/lang/Cargo.toml +++ b/lang/Cargo.toml @@ -28,8 +28,8 @@ rserde = { version = "1.0", optional = true, features = ["derive"], package = "s lalrpop = "0.20.0" [dev-dependencies] -lang-util-dev = "=0.5.3" -glsl-lang-pp = "=0.5.3" +lang-util-dev = "=0.6.0-beta.1" +glsl-lang-pp = "=0.6.0-beta.1" criterion = "0.5" expect-test = "1.3" From 2e9f4caf8f59ff658540acd5ad1c3f478748c962 Mon Sep 17 00:00:00 2001 From: Alixinne Date: Tue, 20 Aug 2024 00:18:46 +0200 Subject: [PATCH 10/10] ci(docs): add permissions for github_token --- .github/workflows/docs.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index f4f53c241..7601ba76d 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -8,7 +8,12 @@ on: jobs: release-docs: name: Build docs + runs-on: ubuntu-latest + + permissions: + contents: write + steps: - uses: actions/checkout@v4 - uses: actions-rs/toolchain@v1