{"record":{"id":"3ccf893636349235","repo":"swc-project/swc","slug":"invalid-an-b-microsyntax","errorCode":null,"errorMessage":"Invalid An+B microsyntax","messagePattern":"Invalid An\\+B microsyntax","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"crates/swc_css_parser/src/parser/selectors/mod.rs","lineNumber":1308,"sourceCode":"                                unreachable!();\n                            }\n                        };\n\n                        let n_char = dimension.2.chars().next();\n\n                        if n_char != Some('n') && n_char != Some('N') {\n                            return Err(Error::new(\n                                span,\n                                ErrorKind::Expected(\"'n' character in Ident\"),\n                            ));\n                        }\n\n                        a = Some(dimension.0 as i32);\n                        a_raw = Some(dimension.1);\n                        n_value =  (*dimension.2).to_string();\n                    }\n                    _ => {\n                        return Err(Error::new(span, ErrorKind::InvalidAnPlusBMicrosyntax));\n                    }\n                };\n\n                self.input.skip_ws();\n\n                let mut b = None;\n                let mut b_raw = None;\n\n                let dash_after_n = n_value.chars().nth(1);\n\n                match cur!(self) {\n                    // '+'? n <signed-integer>\n                    // -n <signed-integer>\n                    // <n-dimension> <signed-integer>\n                    tok!(\"number\") if dash_after_n.is_none() => {\n                        let number = match bump!(self) {\n                            Token::Number { value, raw, .. } => (value, raw),\n                            _ => {","sourceCodeStart":1290,"sourceCodeEnd":1326,"githubUrl":"https://github.com/swc-project/swc/blob/5176682b65416c6b5de6b47379ae1588ea3ecb3f/crates/swc_css_parser/src/parser/selectors/mod.rs#L1290-L1326","documentation":"Fired while parsing the An+B microsyntax (e.g. in :nth-child()): a dimension token representing the `n` part was read, but its unit did not start with the character 'n'/'N', so it is not an <n-dimension>. This is a validation guard on the dimension's unit; input at fault is something like `:nth-child(3x)` instead of `:nth-child(3n)`.","triggerScenarios":"Thrown at crates/swc_css_parser/src/parser/selectors/mod.rs:1308 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Follow `n` with `+`/`-` and a signless integer, or nothing at all","Report the collected error","Fix the selector"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5176682b65416c6b5de6b47379ae1588ea3ecb3f","analyzedAt":"2026-08-17T16:16:52.067Z","contentChangedAt":"2026-08-17T16:16:52.067Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}