{"record":{"id":"c4f9b5f1f3a6a8ef","repo":"stride3d/stride","slug":"exception-of-type-system-notimplementedexception-was-thrown-c4f9b5","errorCode":null,"errorMessage":"Exception of type 'System.NotImplementedException' was thrown.","messagePattern":"Exception of type 'System\\.NotImplementedException' was thrown\\.","errorType":"exception","errorClass":"NotImplementedException","httpStatus":null,"severity":"error","filePath":"sources/shaders/Stride.Shaders.Parsers/Parsing/SDSL/Parsers/Terminals/Terminals.cs","lineNumber":88,"sourceCode":"        => new EOLTokenParser().Match(ref scanner, advance);\n    public static bool EOF<TScanner>(ref TScanner scanner)\n        where TScanner : struct, IScanner\n        => new EOFTokenParser().Match(ref scanner, false);\n\n\n\n    public static bool FloatSuffix<TScanner>(ref TScanner scanner, out Suffix? suffix, bool advance = false)\n        where TScanner : struct, IScanner\n    {\n        suffix = null;\n        if (AnyOf([\"f16\", \"h\", \"f32\", \"f\", \"f64\", \"d\"], ref scanner, out var matched, advance: advance))\n        {\n            suffix = matched switch\n            {\n                \"f16\" or \"h\" => new(16, true, true),\n                \"f32\" or \"f\" => new(32, true, true),\n                \"f64\" or \"d\" => new(64, true, true),\n                _ => throw new NotImplementedException()\n            };\n            return true;\n        }\n        else return false;\n    }\n    public static bool IntSuffix<TScanner>(ref TScanner scanner, out Suffix? suffix, bool advance = false)\n        where TScanner : struct, IScanner\n    {\n        suffix = null;\n        if (AnyOf([\"u32\", \"u\", \"U\", \"i64\", \"l\", \"L\", \"u64\", \"ul\", \"UL\"], ref scanner, out var matched, advance: advance))\n        {\n            suffix = matched switch\n            {\n                \"u32\" or \"u\" or \"U\" => new(32, false, false),\n                \"i64\" or \"l\" or \"L\" => new(64, false, true),\n                \"u64\" or \"ul\" or \"UL\" => new(64, false, false),\n                _ => throw new NotImplementedException()\n            };","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/shaders/Stride.Shaders.Parsers/Parsing/SDSL/Parsers/Terminals/Terminals.cs#L70-L106","documentation":"Terminals.FloatSuffix scans and classifies a floating-point literal suffix. Recognized suffixes are f16/h, f32/f, f64/d; any other scanned suffix falls through the switch and throws NotImplementedException, meaning the suffix grammar is incomplete and hits an unhandled parser state.","triggerScenarios":"Parsing a float literal whose suffix is not f16/h/f32/f/f64/d — e.g. 'lf', 'F', or an unexpected token right after digits that the suffix scanner consumed.","commonSituations":"Porting shaders that use alternate float suffixes (HLSL 'F', GLSL 'LF'); case-sensitivity assumptions (only lowercase 'f'/'h'/'d' accepted); typos in numeric literals.","solutions":["Use a supported suffix: h/f16, f/f32, or d/f64 (lowercase) in the shader source","Add the missing suffix mapping to the switch in Terminals.cs:88","Replace the throw with a parser diagnostic (ParseError) for unknown float suffixes"],"exampleFix":"// before\n_ => throw new NotImplementedException()\n// after\n\"F\" => new(32, true, true),\n_ => throw new ArgumentException($\"Unknown float suffix '{matched}'\")","handlingStrategy":"validation","validationCode":"static readonly System.Text.RegularExpressions.Regex FloatSuffixRe = new(\"^(f16|h|f32|f|f64|d)$\");\nbool HasSupportedFloatSuffix(string lexeme) => FloatSuffixRe.IsMatch(lexeme);","typeGuard":"bool IsKnownFloatSuffix(string s) => s is \"f16\" or \"h\" or \"f32\" or \"f\" or \"f64\" or \"d\";","tryCatchPattern":"try { ok = Terminals.FloatSuffix(ref scanner, out suffix, advance); }\ncatch (NotImplementedException) { orError?.Add(new ParseError(ParseErrorCode.NotImplemented, $\"Unsupported float suffix near {scanner.Position}\")); suffix = null; ok = false; }","preventionTips":["Use only h/f16, f/f32, d/f64 suffixes (lowercase) in SDSL floats","Rewrite HLSL 'F' or GLSL 'LF' suffixes when porting","Add lexer tests covering every documented float suffix","Prefer explicit typed declarations over suffix-dependent typing"],"tags":["shader","parser","sdsl","not-implemented"],"backgroundTag":"method-not-implemented","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}