{"record":{"id":"32ddb0fd87b51227","repo":"swc-project/swc","slug":"a-numeric-separator-is-only-allowed-between-two-di","errorCode":null,"errorMessage":"A numeric separator is only allowed between two digits","messagePattern":"A numeric separator is only allowed between two digits","errorType":"exception","errorClass":"swc_ecma_parser::error::Error","httpStatus":null,"severity":"error","filePath":"crates/swc_ecma_parser/src/lexer/mod.rs","lineNumber":1307,"sourceCode":"        );\n        debug_assert_eq!(self.cur(), Some(b'0'));\n        self.bump(1); // `0`\n\n        debug_assert!(self\n            .cur()\n            .is_some_and(|c| matches!(c, b'b' | b'B' | b'o' | b'O' | b'x' | b'X')));\n        self.bump(1); // `cur` matches one of the bytes above\n\n        let lazy_integer = self.read_number_no_dot_as_str::<RADIX>()?;\n        let has_underscore = lazy_integer.has_underscore;\n\n        let s = unsafe {\n            // Safety: We got both start and end position from `self.input`\n            self.input_slice_str(lazy_integer.start, self.cur_pos())\n        };\n        if self.eat(b'n') {\n            if s.starts_with('_') {\n                return Err(Error::new(\n                    Span::new(lazy_integer.start, lazy_integer.end),\n                    SyntaxError::NumericSeparatorIsAllowedOnlyBetweenTwoDigits,\n                ));\n            }\n\n            let Some(bigint_value) = num_bigint::BigInt::parse_bytes(s.as_bytes(), RADIX as _)\n            else {\n                // just a fallback in case there is anything we did not catch\n                return Err(Error::new(\n                    Span::new(lazy_integer.start, lazy_integer.end),\n                    SyntaxError::ExpectedDigit { radix: RADIX },\n                ));\n            };\n            return Ok(Either::Right(Box::new(bigint_value)));\n        }\n        let s = remove_underscore(s, has_underscore);\n        let val = parse_integer::<RADIX>(&s);\n","sourceCodeStart":1289,"sourceCodeEnd":1325,"githubUrl":"https://github.com/swc-project/swc/blob/5176682b65416c6b5de6b47379ae1588ea3ecb3f/crates/swc_ecma_parser/src/lexer/mod.rs#L1289-L1325","documentation":"Lexer error from read_radix_number: a BigInt radix literal (e.g. 0x1_n) has a numeric separator '_' at the start of its digit string; separators are only permitted between two digits, so the underscore directly after the radix prefix is rejected.","triggerScenarios":"Thrown at crates/swc_ecma_parser/src/lexer/mod.rs:1307 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the underscore adjacent to the radix prefix, e.g. write 0x1_n as 0x1n or 0x1_0n","Place separators strictly between digits"],"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"}