rubberduck-vba / Rubberduck

Every programmer needs a rubberduck. COM add-in for the VBA & VB6 IDE (VBE).
https://rubberduckvba.com
GNU General Public License v3.0
1.91k stars 299 forks source link

"SLL mode failed while parsing" error in log, while parsing Access-VBA on "Debug.Print" #5859

Closed Tanarri closed 2 years ago

Tanarri commented 3 years ago

Rubberduck version information Version 2.5.2.5963 Betriebssystem: Microsoft Windows NT 10.0.19043.0, x64 Hostprodukt: Microsoft Office 2013 x86 Hostversion: 15.0.5349.1000 Hostprogramm: MSACCESS.EXE

Description While I read bugreport #5782 I read the comment from @retailcoder https://github.com/rubberduck-vba/Rubberduck/issues/5782#issuecomment-843353079 I noticed that I had the error "mismatched input '\r\n' expecting {'=', WS, LINE_CONTINUATION}" in my log as well and tried to narrow it down and found why

To Reproduce Steps to reproduce the behavior:

  1. New Access 2013 Database
  2. Create a new modul with following content
    
    Option Compare Database
    Option Explicit

Public Function DemoHello() Debug.Print "Hello world." = "1" End Function

3. Start Rubberduck --> Code Inspection
4. Found in Log

2021-09-24 23:28:15.5893;DEBUG-2.5.2.5963;Rubberduck.Common.LogLevelHelper; Rubberduck version 2.5.2.5963 loading: Operating System: Microsoft Windows NT 10.0.19043.0 x64 Host Product: Microsoft Office 2013 x86 Host Version: 15.0.5349.1000 Host Executable: MSACCESS.EXE; 2021-09-24 23:28:15.8465;INFO-2.5.2.5963;Rubberduck.UI.Command.VersionCheckCommand;Executing version check...; 2021-09-24 23:28:35.5303;DEBUG-2.5.2.5963;Rubberduck.Common.Hotkeys.Hotkey;Hotkey (E) not registered.; 2021-09-24 23:28:37.9200;DEBUG-2.5.2.5963;Rubberduck.UI.Command.MenuItems.ParentMenus.ParentMenuItemBase;(28378434) Executing click handler for menu item 'Code &Inspections', hash code 62083862; 2021-09-24 23:28:37.9200;DEBUG-2.5.2.5963;Rubberduck.Common.Hotkeys.Hotkey;Hotkey (E) not registered.; 2021-09-24 23:28:40.2824;DEBUG-2.5.2.5963;Rubberduck.Parsing.VBA.ParseCoordinator;Parsing run started. (thread 8).; 2021-09-24 23:28:40.3037;INFO-2.5.2.5963;Rubberduck.Parsing.VBA.RubberduckParserState;RubberduckParserState (1) is invoking StateChanged (Started); 2021-09-24 23:28:40.4273;DEBUG-2.5.2.5963;Rubberduck.Parsing.VBA.RubberduckParserState;Module 'Modul1' state is changing to 'Started' (thread 8); 2021-09-24 23:28:40.4273;INFO-2.5.2.5963;Rubberduck.Parsing.VBA.RubberduckParserState;RubberduckParserState (2) is invoking StateChanged (LoadingReference); 2021-09-24 23:28:40.4666;INFO-2.5.2.5963;Rubberduck.Parsing.Common.ParsingStageTimer;Loaded ComProjects for user projects in 31ms.; 2021-09-24 23:28:40.4692;INFO-2.5.2.5963;Rubberduck.Parsing.Common.ParsingStageTimer;Loaded declarations from ComProjects for user projects in 0ms.; 2021-09-24 23:28:41.0760;INFO-2.5.2.5963;Rubberduck.Parsing.Common.ParsingStageTimer;Loaded and unloaded referenced libraries in 601ms.; 2021-09-24 23:28:41.2087;DEBUG-2.5.2.5963;Rubberduck.Parsing.VBA.RubberduckParserState;Module 'Modul1' state is changing to 'Parsing' (thread 8); 2021-09-24 23:28:41.2087;INFO-2.5.2.5963;Rubberduck.Parsing.VBA.RubberduckParserState;RubberduckParserState (3) is invoking StateChanged (Parsing); 2021-09-24 23:28:41.5133;WARN-2.5.2.5963;Rubberduck.Parsing.VBA.Parsing.TokenStreamParserBase;SLL mode failed while parsing the CodePaneCode version of module Modul1 at symbol at L5C37. Retrying using LL.; 2021-09-24 23:28:41.5144;DEBUG-2.5.2.5963;Rubberduck.Parsing.VBA.Parsing.TokenStreamParserBase;Rubberduck.Parsing.VBA.Parsing.ParsingExceptions.MainParseSyntaxErrorException: mismatched input '\r\n' expecting {'=', WS, LINE_CONTINUATION} ---> Antlr4.Runtime.InputMismatchException: Eine Ausnahme vom Typ "Antlr4.Runtime.InputMismatchException" wurde ausgelöst. bei Antlr4.Runtime.DefaultErrorStrategy.Sync(Parser recognizer) bei Rubberduck.Parsing.Grammar.VBAParser.letStmt() in C:\projects\rubberduck\Rubberduck.Parsing\obj\Release\VBAParser.cs:Zeile 9893. --- Ende der internen Ausnahmestapelüberwachung --- bei Rubberduck.Parsing.VBA.Parsing.ParsingExceptions.MainParseExceptionErrorListener.SyntaxError(IRecognizer recognizer, IToken offendingSymbol, Int32 line, Int32 charPositionInLine, String msg, RecognitionException e) in C:\projects\rubberduck\Rubberduck.Parsing\VBA\Parsing\ParsingExceptions\MainParseExceptionErrorListener.cs:Zeile 14. bei Antlr4.Runtime.ProxyErrorListener1.SyntaxError(IRecognizer recognizer, Symbol offendingSymbol, Int32 line, Int32 charPositionInLine, String msg, RecognitionException e) bei Antlr4.Runtime.Parser.NotifyErrorListeners(IToken offendingToken, String msg, RecognitionException e) bei Antlr4.Runtime.DefaultErrorStrategy.NotifyErrorListeners(Parser recognizer, String message, RecognitionException e) bei Antlr4.Runtime.DefaultErrorStrategy.ReportInputMismatch(Parser recognizer, InputMismatchException e) bei Antlr4.Runtime.DefaultErrorStrategy.ReportError(Parser recognizer, RecognitionException e) bei Rubberduck.Parsing.Grammar.VBAParser.letStmt() in C:\projects\rubberduck\Rubberduck.Parsing\obj\Release\VBAParser.cs:Zeile 9916. bei Rubberduck.Parsing.Grammar.VBAParser.mainBlockStmt() in C:\projects\rubberduck\Rubberduck.Parsing\obj\Release\VBAParser.cs:Zeile 2812. bei Rubberduck.Parsing.Grammar.VBAParser.blockStmt() in C:\projects\rubberduck\Rubberduck.Parsing\obj\Release\VBAParser.cs:Zeile 2535. bei Rubberduck.Parsing.Grammar.VBAParser.block() in C:\projects\rubberduck\Rubberduck.Parsing\obj\Release\VBAParser.cs:Zeile 2376. bei Rubberduck.Parsing.Grammar.VBAParser.functionStmt() in C:\projects\rubberduck\Rubberduck.Parsing\obj\Release\VBAParser.cs:Zeile 8615. bei Rubberduck.Parsing.Grammar.VBAParser.moduleBodyElement() in C:\projects\rubberduck\Rubberduck.Parsing\obj\Release\VBAParser.cs:Zeile 2284. bei Rubberduck.Parsing.Grammar.VBAParser.moduleBody() in C:\projects\rubberduck\Rubberduck.Parsing\obj\Release\VBAParser.cs:Zeile 2205. bei Rubberduck.Parsing.Grammar.VBAParser.module() in C:\projects\rubberduck\Rubberduck.Parsing\obj\Release\VBAParser.cs:Zeile 447. bei Rubberduck.Parsing.Grammar.VBAParser.startRule() in C:\projects\rubberduck\Rubberduck.Parsing\obj\Release\VBAParser.cs:Zeile 335. bei Rubberduck.Parsing.VBA.Parsing.VBATokenStreamParser.Parse(ITokenStream tokenStream, PredictionMode predictionMode, IParserErrorListener errorListener) in C:\projects\rubberduck\Rubberduck.Parsing\VBA\Parsing\VBATokenStreamParser.cs:Zeile 21. bei Rubberduck.Parsing.VBA.Parsing.TokenStreamParserBase.ParseSll(String moduleName, ITokenStream tokenStream, CodeKind codeKind) in C:\projects\rubberduck\Rubberduck.Parsing\VBA\Parsing\TokenStreamParserBase.cs:Zeile 86. bei Rubberduck.Parsing.VBA.Parsing.TokenStreamParserBase.ParseWithFallBack(String moduleName, CommonTokenStream tokenStream, CodeKind codeKind) in C:\projects\rubberduck\Rubberduck.Parsing\VBA\Parsing\TokenStreamParserBase.cs:Zeile 47. Token: at L5C37 Kind of parsed code: CodePaneCode Component: Modul1 (code pane version) ParseType: Main parse;Rubberduck.Parsing.VBA.Parsing.ParsingExceptions.MainParseSyntaxErrorException: mismatched input '\r\n' expecting {'=', WS, LINE_CONTINUATION} ---> Antlr4.Runtime.InputMismatchException: Eine Ausnahme vom Typ "Antlr4.Runtime.InputMismatchException" wurde ausgelöst. bei Antlr4.Runtime.DefaultErrorStrategy.Sync(Parser recognizer) bei Rubberduck.Parsing.Grammar.VBAParser.letStmt() in C:\projects\rubberduck\Rubberduck.Parsing\obj\Release\VBAParser.cs:Zeile 9893. --- Ende der internen Ausnahmestapelüberwachung --- bei Rubberduck.Parsing.VBA.Parsing.ParsingExceptions.MainParseExceptionErrorListener.SyntaxError(IRecognizer recognizer, IToken offendingSymbol, Int32 line, Int32 charPositionInLine, String msg, RecognitionException e) in C:\projects\rubberduck\Rubberduck.Parsing\VBA\Parsing\ParsingExceptions\MainParseExceptionErrorListener.cs:Zeile 14. bei Antlr4.Runtime.ProxyErrorListener1.SyntaxError(IRecognizer recognizer, Symbol offendingSymbol, Int32 line, Int32 charPositionInLine, String msg, RecognitionException e) bei Antlr4.Runtime.Parser.NotifyErrorListeners(IToken offendingToken, String msg, RecognitionException e) bei Antlr4.Runtime.DefaultErrorStrategy.NotifyErrorListeners(Parser recognizer, String message, RecognitionException e) bei Antlr4.Runtime.DefaultErrorStrategy.ReportInputMismatch(Parser recognizer, InputMismatchException e) bei Antlr4.Runtime.DefaultErrorStrategy.ReportError(Parser recognizer, RecognitionException e) bei Rubberduck.Parsing.Grammar.VBAParser.letStmt() in C:\projects\rubberduck\Rubberduck.Parsing\obj\Release\VBAParser.cs:Zeile 9916. bei Rubberduck.Parsing.Grammar.VBAParser.mainBlockStmt() in C:\projects\rubberduck\Rubberduck.Parsing\obj\Release\VBAParser.cs:Zeile 2812. bei Rubberduck.Parsing.Grammar.VBAParser.blockStmt() in C:\projects\rubberduck\Rubberduck.Parsing\obj\Release\VBAParser.cs:Zeile 2535. bei Rubberduck.Parsing.Grammar.VBAParser.block() in C:\projects\rubberduck\Rubberduck.Parsing\obj\Release\VBAParser.cs:Zeile 2376. bei Rubberduck.Parsing.Grammar.VBAParser.functionStmt() in C:\projects\rubberduck\Rubberduck.Parsing\obj\Release\VBAParser.cs:Zeile 8615. bei Rubberduck.Parsing.Grammar.VBAParser.moduleBodyElement() in C:\projects\rubberduck\Rubberduck.Parsing\obj\Release\VBAParser.cs:Zeile 2284. bei Rubberduck.Parsing.Grammar.VBAParser.moduleBody() in C:\projects\rubberduck\Rubberduck.Parsing\obj\Release\VBAParser.cs:Zeile 2205. bei Rubberduck.Parsing.Grammar.VBAParser.module() in C:\projects\rubberduck\Rubberduck.Parsing\obj\Release\VBAParser.cs:Zeile 447. bei Rubberduck.Parsing.Grammar.VBAParser.startRule() in C:\projects\rubberduck\Rubberduck.Parsing\obj\Release\VBAParser.cs:Zeile 335. bei Rubberduck.Parsing.VBA.Parsing.VBATokenStreamParser.Parse(ITokenStream tokenStream, PredictionMode predictionMode, IParserErrorListener errorListener) in C:\projects\rubberduck\Rubberduck.Parsing\VBA\Parsing\VBATokenStreamParser.cs:Zeile 21. bei Rubberduck.Parsing.VBA.Parsing.TokenStreamParserBase.ParseSll(String moduleName, ITokenStream tokenStream, CodeKind codeKind) in C:\projects\rubberduck\Rubberduck.Parsing\VBA\Parsing\TokenStreamParserBase.cs:Zeile 86. bei Rubberduck.Parsing.VBA.Parsing.TokenStreamParserBase.ParseWithFallBack(String moduleName, CommonTokenStream tokenStream, CodeKind codeKind) in C:\projects\rubberduck\Rubberduck.Parsing\VBA\Parsing\TokenStreamParserBase.cs:Zeile 47. Token: at L5C37 Kind of parsed code: CodePaneCode Component: Modul1 (code pane version) ParseType: Main parse 2021-09-24 23:28:41.5579;WARN-2.5.2.5963;Rubberduck.Parsing.VBA.Parsing.TokenStreamParserBase;SLL mode failed while parsing the AttributesCode version of module Modul1 at symbol at L6C37. Retrying using LL.; 2021-09-24 23:28:41.5579;DEBUG-2.5.2.5963;Rubberduck.Parsing.VBA.Parsing.TokenStreamParserBase;Rubberduck.Parsing.VBA.Parsing.ParsingExceptions.MainParseSyntaxErrorException: mismatched input '\r\n' expecting {'=', WS, LINE_CONTINUATION} ---> Antlr4.Runtime.InputMismatchException: Eine Ausnahme vom Typ "Antlr4.Runtime.InputMismatchException" wurde ausgelöst. bei Antlr4.Runtime.DefaultErrorStrategy.Sync(Parser recognizer) bei Rubberduck.Parsing.Grammar.VBAParser.letStmt() in C:\projects\rubberduck\Rubberduck.Parsing\obj\Release\VBAParser.cs:Zeile 9893. --- Ende der internen Ausnahmestapelüberwachung --- bei Rubberduck.Parsing.VBA.Parsing.ParsingExceptions.MainParseExceptionErrorListener.SyntaxError(IRecognizer recognizer, IToken offendingSymbol, Int32 line, Int32 charPositionInLine, String msg, RecognitionException e) in C:\projects\rubberduck\Rubberduck.Parsing\VBA\Parsing\ParsingExceptions\MainParseExceptionErrorListener.cs:Zeile 14. bei Antlr4.Runtime.ProxyErrorListener1.SyntaxError(IRecognizer recognizer, Symbol offendingSymbol, Int32 line, Int32 charPositionInLine, String msg, RecognitionException e) bei Antlr4.Runtime.Parser.NotifyErrorListeners(IToken offendingToken, String msg, RecognitionException e) bei Antlr4.Runtime.DefaultErrorStrategy.NotifyErrorListeners(Parser recognizer, String message, RecognitionException e) bei Antlr4.Runtime.DefaultErrorStrategy.ReportInputMismatch(Parser recognizer, InputMismatchException e) bei Antlr4.Runtime.DefaultErrorStrategy.ReportError(Parser recognizer, RecognitionException e) bei Rubberduck.Parsing.Grammar.VBAParser.letStmt() in C:\projects\rubberduck\Rubberduck.Parsing\obj\Release\VBAParser.cs:Zeile 9916. bei Rubberduck.Parsing.Grammar.VBAParser.mainBlockStmt() in C:\projects\rubberduck\Rubberduck.Parsing\obj\Release\VBAParser.cs:Zeile 2812. bei Rubberduck.Parsing.Grammar.VBAParser.blockStmt() in C:\projects\rubberduck\Rubberduck.Parsing\obj\Release\VBAParser.cs:Zeile 2535. bei Rubberduck.Parsing.Grammar.VBAParser.block() in C:\projects\rubberduck\Rubberduck.Parsing\obj\Release\VBAParser.cs:Zeile 2376. bei Rubberduck.Parsing.Grammar.VBAParser.functionStmt() in C:\projects\rubberduck\Rubberduck.Parsing\obj\Release\VBAParser.cs:Zeile 8615. bei Rubberduck.Parsing.Grammar.VBAParser.moduleBodyElement() in C:\projects\rubberduck\Rubberduck.Parsing\obj\Release\VBAParser.cs:Zeile 2284. bei Rubberduck.Parsing.Grammar.VBAParser.moduleBody() in C:\projects\rubberduck\Rubberduck.Parsing\obj\Release\VBAParser.cs:Zeile 2205. bei Rubberduck.Parsing.Grammar.VBAParser.module() in C:\projects\rubberduck\Rubberduck.Parsing\obj\Release\VBAParser.cs:Zeile 447. bei Rubberduck.Parsing.Grammar.VBAParser.startRule() in C:\projects\rubberduck\Rubberduck.Parsing\obj\Release\VBAParser.cs:Zeile 335. bei Rubberduck.Parsing.VBA.Parsing.VBATokenStreamParser.Parse(ITokenStream tokenStream, PredictionMode predictionMode, IParserErrorListener errorListener) in C:\projects\rubberduck\Rubberduck.Parsing\VBA\Parsing\VBATokenStreamParser.cs:Zeile 21. bei Rubberduck.Parsing.VBA.Parsing.TokenStreamParserBase.ParseSll(String moduleName, ITokenStream tokenStream, CodeKind codeKind) in C:\projects\rubberduck\Rubberduck.Parsing\VBA\Parsing\TokenStreamParserBase.cs:Zeile 86. bei Rubberduck.Parsing.VBA.Parsing.TokenStreamParserBase.ParseWithFallBack(String moduleName, CommonTokenStream tokenStream, CodeKind codeKind) in C:\projects\rubberduck\Rubberduck.Parsing\VBA\Parsing\TokenStreamParserBase.cs:Zeile 47. Token: at L6C37 Kind of parsed code: AttributesCode Component: Modul1 (exported version) ParseType: Main parse;Rubberduck.Parsing.VBA.Parsing.ParsingExceptions.MainParseSyntaxErrorException: mismatched input '\r\n' expecting {'=', WS, LINE_CONTINUATION} ---> Antlr4.Runtime.InputMismatchException: Eine Ausnahme vom Typ "Antlr4.Runtime.InputMismatchException" wurde ausgelöst. bei Antlr4.Runtime.DefaultErrorStrategy.Sync(Parser recognizer) bei Rubberduck.Parsing.Grammar.VBAParser.letStmt() in C:\projects\rubberduck\Rubberduck.Parsing\obj\Release\VBAParser.cs:Zeile 9893. --- Ende der internen Ausnahmestapelüberwachung --- bei Rubberduck.Parsing.VBA.Parsing.ParsingExceptions.MainParseExceptionErrorListener.SyntaxError(IRecognizer recognizer, IToken offendingSymbol, Int32 line, Int32 charPositionInLine, String msg, RecognitionException e) in C:\projects\rubberduck\Rubberduck.Parsing\VBA\Parsing\ParsingExceptions\MainParseExceptionErrorListener.cs:Zeile 14. bei Antlr4.Runtime.ProxyErrorListener1.SyntaxError(IRecognizer recognizer, Symbol offendingSymbol, Int32 line, Int32 charPositionInLine, String msg, RecognitionException e) bei Antlr4.Runtime.Parser.NotifyErrorListeners(IToken offendingToken, String msg, RecognitionException e) bei Antlr4.Runtime.DefaultErrorStrategy.NotifyErrorListeners(Parser recognizer, String message, RecognitionException e) bei Antlr4.Runtime.DefaultErrorStrategy.ReportInputMismatch(Parser recognizer, InputMismatchException e) bei Antlr4.Runtime.DefaultErrorStrategy.ReportError(Parser recognizer, RecognitionException e) bei Rubberduck.Parsing.Grammar.VBAParser.letStmt() in C:\projects\rubberduck\Rubberduck.Parsing\obj\Release\VBAParser.cs:Zeile 9916. bei Rubberduck.Parsing.Grammar.VBAParser.mainBlockStmt() in C:\projects\rubberduck\Rubberduck.Parsing\obj\Release\VBAParser.cs:Zeile 2812. bei Rubberduck.Parsing.Grammar.VBAParser.blockStmt() in C:\projects\rubberduck\Rubberduck.Parsing\obj\Release\VBAParser.cs:Zeile 2535. bei Rubberduck.Parsing.Grammar.VBAParser.block() in C:\projects\rubberduck\Rubberduck.Parsing\obj\Release\VBAParser.cs:Zeile 2376. bei Rubberduck.Parsing.Grammar.VBAParser.functionStmt() in C:\projects\rubberduck\Rubberduck.Parsing\obj\Release\VBAParser.cs:Zeile 8615. bei Rubberduck.Parsing.Grammar.VBAParser.moduleBodyElement() in C:\projects\rubberduck\Rubberduck.Parsing\obj\Release\VBAParser.cs:Zeile 2284. bei Rubberduck.Parsing.Grammar.VBAParser.moduleBody() in C:\projects\rubberduck\Rubberduck.Parsing\obj\Release\VBAParser.cs:Zeile 2205. bei Rubberduck.Parsing.Grammar.VBAParser.module() in C:\projects\rubberduck\Rubberduck.Parsing\obj\Release\VBAParser.cs:Zeile 447. bei Rubberduck.Parsing.Grammar.VBAParser.startRule() in C:\projects\rubberduck\Rubberduck.Parsing\obj\Release\VBAParser.cs:Zeile 335. bei Rubberduck.Parsing.VBA.Parsing.VBATokenStreamParser.Parse(ITokenStream tokenStream, PredictionMode predictionMode, IParserErrorListener errorListener) in C:\projects\rubberduck\Rubberduck.Parsing\VBA\Parsing\VBATokenStreamParser.cs:Zeile 21. bei Rubberduck.Parsing.VBA.Parsing.TokenStreamParserBase.ParseSll(String moduleName, ITokenStream tokenStream, CodeKind codeKind) in C:\projects\rubberduck\Rubberduck.Parsing\VBA\Parsing\TokenStreamParserBase.cs:Zeile 86. bei Rubberduck.Parsing.VBA.Parsing.TokenStreamParserBase.ParseWithFallBack(String moduleName, CommonTokenStream tokenStream, CodeKind codeKind) in C:\projects\rubberduck\Rubberduck.Parsing\VBA\Parsing\TokenStreamParserBase.cs:Zeile 47. Token: at L6C37 Kind of parsed code: AttributesCode Component: Modul1 (exported version) ParseType: Main parse


**Expected behavior**
No DEBUG entries in "RubberduckLog.txt":
Rubberduck.Parsing.VBA.Parsing.TokenStreamParserBase;Rubberduck.Parsing.VBA.Parsing.ParsingExceptions.MainParseSyntaxErrorException: mismatched input '\r\n' expecting {'=', WS, LINE_CONTINUATION} 

**Logfile**
[RubberduckLog.txt](https://github.com/rubberduck-vba/Rubberduck/files/7228482/RubberduckLog.txt)
Vogel612 commented 2 years ago

SLL mode failures are not really a bug. They are a bit complex to explain, but basically fixing this particular set of SLL failures will invariably introduce a new set.

As such it's preferrable to have an SLL failure set that occurs as little as possible and Debug.Print is one place where we decided to just "take" the SLL failures. As such this behaviour is [status-bydesign]