vosen/ZLUDA · error

Expected `unified`, got `{}`

Error message

Expected `unified`, got `{}`

What it means

Proc-macro parse error from the PTX parser generator: while parsing an instruction operand state descriptor it encountered a token other than `unified` where `unified` was expected. This is an error in the ZLUDA project's own grammar source (ptx_parser_macros macros), not in user PTX code — a state-parsing rule was written with the wrong token order or a typo.

Source

Thrown at ptx_parser_macros_impl/src/parser.rs:569

            } else if lookahead.peek(token::Bracket) {
                let bracketed;
                bracketed!(bracketed in input);
                if bracketed.peek(Token![|]) {
                    optional = true;
                    bracketed.parse::<Token![|]>()?;
                    pre_pipe = true;
                    ident = bracketed.parse::<HyphenatedIdent>()?;
                } else {
                    let mut sub_args = Self::parse(&bracketed)?;
                    sub_args.0.first_mut().unwrap().pre_bracket = true;
                    sub_args.0.last_mut().unwrap().post_bracket = true;
                    if peek_brace_token(input, Token![.]) {
                        let optional_suffix;
                        braced!(optional_suffix in input);
                        optional_suffix.parse::<Token![.]>()?;
                        let unified_ident = optional_suffix.parse::<Ident>()?;
                        if unified_ident.to_string() != "unified" {
                            return Err(syn::Error::new(
                                unified_ident.span(),
                                format!("Expected `unified`, got `{}`", unified_ident),
                            ));
                        }
                        for a in sub_args.0.iter_mut() {
                            a.unified = true;
                        }
                    }
                    result.extend(sub_args.0);
                    continue;
                }
            } else if lookahead.peek(Ident) {
                ident = input.parse::<HyphenatedIdent>()?;
            } else if lookahead.peek(Token![|]) {
                input.parse::<Token![|]>()?;
                pre_pipe = true;
                ident = input.parse::<HyphenatedIdent>()?;
            } else {

View on GitHub (pinned to 9c8b43f242)

Solutions

  1. Inspect the grammar rule around the error site in ptx_parser_macros_impl and place `unified` where the parser expects it
  2. Verify optional/bracketed operand syntax matches what the sub-parser produces
  3. Update to a upstream revision where the grammar compiles
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at ptx_parser_macros_impl/src/parser.rs:569 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of vosen/ZLUDA@9c8b43f242 (2026-09-06). Data as JSON: /api/errors/8a85cac4bb5314f1. Report an issue: GitHub.