{"record":{"id":"39f2389053b12ee2","repo":"stride3d/stride","slug":"warning-at-line-column-msg-source","errorCode":null,"errorMessage":"Warning at {line}:{column}: {msg}","messagePattern":"Warning at (.+?):(.+?): (.+?)","errorType":"exception","errorClass":"LexerException","httpStatus":null,"severity":"warning","filePath":"sources/shaders/Stride.Shaders.Parsers/CppNet/Source.cs","lineNumber":293,"sourceCode":"            }\n        }\n\n        protected void error(int line, int column, String msg)\n        {\n            if(listener != null)\n                listener.handleError(this, line, column, msg);\n            else\n                throw new LexerException(\"Error at \" + line + \":\" + column + \": \" + msg);\n        }\n\n        protected void warning(int line, int column, String msg)\n        {\n            if(werror)\n                error(line, column, msg);\n            else if(listener != null)\n                listener.handleWarning(this, line, column, msg);\n            else\n                throw new LexerException(\"Warning at \" + line + \":\" + column + \": \" + msg);\n        }\n\n        public virtual void close()\n        {\n        }\n    }\n\n}","sourceCodeStart":275,"sourceCodeEnd":301,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/shaders/Stride.Shaders.Parsers/CppNet/Source.cs#L275-L301","documentation":"Source.warning() emits preprocessor warnings: escalated to error() when werror is set, routed to listener.handleWarning() if a listener exists, and otherwise thrown as LexerException(\"Warning at line:column: msg\"). This is the Source-level counterpart of Preprocessor.warning().","triggerScenarios":"A Lexer/Source subclass (e.g. skipline paths) diagnoses a warning condition with no listener installed, or with werror enabled turning it fatal.","commonSituations":"Direct use of individual lexer Source objects rather than the top-level Preprocessor; scripts parsing GLSL/HLSL without wiring a listener.","solutions":["Attach a PreprocessorListener so warnings go to handleWarning","Turn off werror if warnings should stay non-fatal","Fix the construct in the shader source flagged at line:column","Catch LexerException at the preprocessing call site"],"exampleFix":"// before\nvar lexer = new FileLexer(file); // no listener\n// after\nvar lexer = new FileLexer(file);\nlexer.setListener(new MyListener());","handlingStrategy":"try-catch","validationCode":"if (werror && !suppressWarnings) error(line, column, msg); else warn(line, column, msg);","typeGuard":null,"tryCatchPattern":"try { Process(lexer); } catch (LexerException e) when (e.Message.StartsWith(\"Warning at \")) { log.Warn($\"Preprocessor warning (fatal, no listener): {e.Message}\"); }","preventionTips":["Install a listener so warnings are non-fatal","Keep werror off unless warnings-as-errors is intended"],"tags":["shader","preprocessor","lexer"],"backgroundTag":"invalid-argument-value","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"}