{"action":"closed","issue":{"url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/issues/2950","repository_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck","labels_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/issues/2950/labels{/name}","comments_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/issues/2950/comments","events_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/issues/2950/events","html_url":"https://github.com/rubberduck-vba/Rubberduck/issues/2950","id":220396874,"number":2950,"title":"SyntaxErrorException with multiple spaces between array decalration's bounds and As keyword","user":{"login":"ThunderFrame","id":16574009,"avatar_url":"https://avatars2.githubusercontent.com/u/16574009?v=4","gravatar_id":"","url":"https://api.github.com/users/ThunderFrame","html_url":"https://github.com/ThunderFrame","followers_url":"https://api.github.com/users/ThunderFrame/followers","following_url":"https://api.github.com/users/ThunderFrame/following{/other_user}","gists_url":"https://api.github.com/users/ThunderFrame/gists{/gist_id}","starred_url":"https://api.github.com/users/ThunderFrame/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThunderFrame/subscriptions","organizations_url":"https://api.github.com/users/ThunderFrame/orgs","repos_url":"https://api.github.com/users/ThunderFrame/repos","events_url":"https://api.github.com/users/ThunderFrame/events{/privacy}","received_events_url":"https://api.github.com/users/ThunderFrame/received_events","type":"User","site_admin":false},"labels":[{"id":141909750,"url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/labels/bug","name":"bug","color":"b60205","default":true},{"id":175554363,"url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/labels/parse-tree-processing","name":"parse-tree-processing","color":"DDDDDD","default":false}],"state":"closed","locked":false,"assignee":{"login":"MDoerner","id":22868956,"avatar_url":"https://avatars1.githubusercontent.com/u/22868956?v=4","gravatar_id":"","url":"https://api.github.com/users/MDoerner","html_url":"https://github.com/MDoerner","followers_url":"https://api.github.com/users/MDoerner/followers","following_url":"https://api.github.com/users/MDoerner/following{/other_user}","gists_url":"https://api.github.com/users/MDoerner/gists{/gist_id}","starred_url":"https://api.github.com/users/MDoerner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MDoerner/subscriptions","organizations_url":"https://api.github.com/users/MDoerner/orgs","repos_url":"https://api.github.com/users/MDoerner/repos","events_url":"https://api.github.com/users/MDoerner/events{/privacy}","received_events_url":"https://api.github.com/users/MDoerner/received_events","type":"User","site_admin":false},"assignees":[{"login":"MDoerner","id":22868956,"avatar_url":"https://avatars1.githubusercontent.com/u/22868956?v=4","gravatar_id":"","url":"https://api.github.com/users/MDoerner","html_url":"https://github.com/MDoerner","followers_url":"https://api.github.com/users/MDoerner/followers","following_url":"https://api.github.com/users/MDoerner/following{/other_user}","gists_url":"https://api.github.com/users/MDoerner/gists{/gist_id}","starred_url":"https://api.github.com/users/MDoerner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MDoerner/subscriptions","organizations_url":"https://api.github.com/users/MDoerner/orgs","repos_url":"https://api.github.com/users/MDoerner/repos","events_url":"https://api.github.com/users/MDoerner/events{/privacy}","received_events_url":"https://api.github.com/users/MDoerner/received_events","type":"User","site_admin":false}],"milestone":null,"comments":4,"created_at":"2017-04-08T12:31:15Z","updated_at":"2018-02-20T15:08:29Z","closed_at":"2018-02-20T15:08:29Z","author_association":"MEMBER","body":"The exception is confined to the log file, and the module ends up parsing, but a module level and procedure level array declaration both encounter the exception - although **the exact error detail differs according to the scope of the declaration**:\r\n\r\nThe exceptions don't occur if there is only a single space between the `)` and `As`:\r\n\r\n```vb\r\nDim Foo1(0 To 3) As Long\r\n```\r\n\r\nBut do occur with 2 or more spaces\r\n```vb\r\nDim Foo1(0 To 3)    As Long\r\n```\r\n\r\n**Module 1 - Procedure level array declaration**\r\n```vb\r\nOption Explicit\r\n\r\n'Dim Foo1(0 To 3)       As Long\r\n\r\n\r\nSub Test()\r\n    Dim Foo2(0 To 3)       As Long\r\nEnd Sub\r\n```\r\n\r\n**Trace Log**\r\n```text\r\n2017-04-08 22:17:12.8109;DEBUG-2.0.14.39296;Rubberduck.Parsing.Symbols.SyntaxErrorException;;\r\n2017-04-08 22:17:12.8109;DEBUG-2.0.14.39296;Rubberduck.Parsing.Symbols.SyntaxErrorException;Token: Long (L8C31);\r\n2017-04-08 22:17:12.8190;WARN-2.0.14.39296;Rubberduck.Parsing.VBA.VBAModuleParser;SLL mode failed in module Module2. Retrying using LL.;Rubberduck.Parsing.Symbols.SyntaxErrorException: extraneous input 'Long' expecting {':', WS, LINE_CONTINUATION}\r\n   at Rubberduck.Parsing.Symbols.ExceptionErrorListener.SyntaxError(IRecognizer recognizer, IToken offendingSymbol, Int32 line, Int32 charPositionInLine, String msg, RecognitionException e) in C:\\Users\\Andrew\\Documents\\GitHub\\Rubberduck\\Rubberduck.Parsing\\Symbols\\ExceptionErrorListener.cs:line 10\r\n   at Antlr4.Runtime.ProxyErrorListener`1.SyntaxError(IRecognizer recognizer, Symbol offendingSymbol, Int32 line, Int32 charPositionInLine, String msg, RecognitionException e)\r\n   at Antlr4.Runtime.Parser.NotifyErrorListeners(IToken offendingToken, String msg, RecognitionException e)\r\n   at Antlr4.Runtime.DefaultErrorStrategy.ReportUnwantedToken(Parser recognizer)\r\n   at Antlr4.Runtime.DefaultErrorStrategy.Sync(Parser recognizer)\r\n   at Rubberduck.Parsing.Grammar.VBAParser.whiteSpace() in C:\\Users\\Andrew\\Documents\\GitHub\\Rubberduck\\Rubberduck.Parsing\\Grammar\\VBAParser.cs:line 19433\r\n   at Rubberduck.Parsing.Grammar.VBAParser.identifierStatementLabel() in C:\\Users\\Andrew\\Documents\\GitHub\\Rubberduck\\Rubberduck.Parsing\\Grammar\\VBAParser.cs:line 15270\r\n   at Rubberduck.Parsing.Grammar.VBAParser.statementLabelDefinition() in C:\\Users\\Andrew\\Documents\\GitHub\\Rubberduck\\Rubberduck.Parsing\\Grammar\\VBAParser.cs:line 15202\r\n   at Rubberduck.Parsing.Grammar.VBAParser.blockStmt() in C:\\Users\\Andrew\\Documents\\GitHub\\Rubberduck\\Rubberduck.Parsing\\Grammar\\VBAParser.cs:line 1701\r\n   at Rubberduck.Parsing.Grammar.VBAParser.block() in C:\\Users\\Andrew\\Documents\\GitHub\\Rubberduck\\Rubberduck.Parsing\\Grammar\\VBAParser.cs:line 1537\r\n   at Rubberduck.Parsing.Grammar.VBAParser.subStmt() in C:\\Users\\Andrew\\Documents\\GitHub\\Rubberduck\\Rubberduck.Parsing\\Grammar\\VBAParser.cs:line 11309\r\n   at Rubberduck.Parsing.Grammar.VBAParser.moduleBodyElement() in C:\\Users\\Andrew\\Documents\\GitHub\\Rubberduck\\Rubberduck.Parsing\\Grammar\\VBAParser.cs:line 1473\r\n   at Rubberduck.Parsing.Grammar.VBAParser.moduleBody() in C:\\Users\\Andrew\\Documents\\GitHub\\Rubberduck\\Rubberduck.Parsing\\Grammar\\VBAParser.cs:line 1377\r\n   at Rubberduck.Parsing.Grammar.VBAParser.module() in C:\\Users\\Andrew\\Documents\\GitHub\\Rubberduck\\Rubberduck.Parsing\\Grammar\\VBAParser.cs:line 354\r\n   at Rubberduck.Parsing.Grammar.VBAParser.startRule() in C:\\Users\\Andrew\\Documents\\GitHub\\Rubberduck\\Rubberduck.Parsing\\Grammar\\VBAParser.cs:line 264\r\n   at Rubberduck.Parsing.VBA.VBAModuleParser.Parse(String moduleName, String moduleCode, IParseTreeListener[] listeners, BaseErrorListener errorListener, ITokenStream& outStream) in C:\\Users\\Andrew\\Documents\\GitHub\\Rubberduck\\Rubberduck.Parsing\\VBA\\VBAModuleParser.cs:line 25\r\n2017-04-08 22:17:12.8470;DEBUG-2.0.14.39296;Rubberduck.Parsing.Symbols.SyntaxErrorException;;\r\n2017-04-08 22:17:12.8470;DEBUG-2.0.14.39296;Rubberduck.Parsing.Symbols.SyntaxErrorException;Token: Long (L7C31);\r\n2017-04-08 22:17:12.8470;WARN-2.0.14.39296;Rubberduck.Parsing.VBA.VBAModuleParser;SLL mode failed in module Module2. Retrying using LL.;Rubberduck.Parsing.Symbols.SyntaxErrorException: extraneous input 'Long' expecting {':', WS, LINE_CONTINUATION}\r\n   at Rubberduck.Parsing.Symbols.ExceptionErrorListener.SyntaxError(IRecognizer recognizer, IToken offendingSymbol, Int32 line, Int32 charPositionInLine, String msg, RecognitionException e) in C:\\Users\\Andrew\\Documents\\GitHub\\Rubberduck\\Rubberduck.Parsing\\Symbols\\ExceptionErrorListener.cs:line 10\r\n   at Antlr4.Runtime.ProxyErrorListener`1.SyntaxError(IRecognizer recognizer, Symbol offendingSymbol, Int32 line, Int32 charPositionInLine, String msg, RecognitionException e)\r\n   at Antlr4.Runtime.Parser.NotifyErrorListeners(IToken offendingToken, String msg, RecognitionException e)\r\n   at Antlr4.Runtime.DefaultErrorStrategy.ReportUnwantedToken(Parser recognizer)\r\n   at Antlr4.Runtime.DefaultErrorStrategy.Sync(Parser recognizer)\r\n   at Rubberduck.Parsing.Grammar.VBAParser.whiteSpace() in C:\\Users\\Andrew\\Documents\\GitHub\\Rubberduck\\Rubberduck.Parsing\\Grammar\\VBAParser.cs:line 19433\r\n   at Rubberduck.Parsing.Grammar.VBAParser.identifierStatementLabel() in C:\\Users\\Andrew\\Documents\\GitHub\\Rubberduck\\Rubberduck.Parsing\\Grammar\\VBAParser.cs:line 15270\r\n   at Rubberduck.Parsing.Grammar.VBAParser.statementLabelDefinition() in C:\\Users\\Andrew\\Documents\\GitHub\\Rubberduck\\Rubberduck.Parsing\\Grammar\\VBAParser.cs:line 15202\r\n   at Rubberduck.Parsing.Grammar.VBAParser.blockStmt() in C:\\Users\\Andrew\\Documents\\GitHub\\Rubberduck\\Rubberduck.Parsing\\Grammar\\VBAParser.cs:line 1701\r\n   at Rubberduck.Parsing.Grammar.VBAParser.block() in C:\\Users\\Andrew\\Documents\\GitHub\\Rubberduck\\Rubberduck.Parsing\\Grammar\\VBAParser.cs:line 1537\r\n   at Rubberduck.Parsing.Grammar.VBAParser.subStmt() in C:\\Users\\Andrew\\Documents\\GitHub\\Rubberduck\\Rubberduck.Parsing\\Grammar\\VBAParser.cs:line 11309\r\n   at Rubberduck.Parsing.Grammar.VBAParser.moduleBodyElement() in C:\\Users\\Andrew\\Documents\\GitHub\\Rubberduck\\Rubberduck.Parsing\\Grammar\\VBAParser.cs:line 1473\r\n   at Rubberduck.Parsing.Grammar.VBAParser.moduleBody() in C:\\Users\\Andrew\\Documents\\GitHub\\Rubberduck\\Rubberduck.Parsing\\Grammar\\VBAParser.cs:line 1377\r\n   at Rubberduck.Parsing.Grammar.VBAParser.module() in C:\\Users\\Andrew\\Documents\\GitHub\\Rubberduck\\Rubberduck.Parsing\\Grammar\\VBAParser.cs:line 354\r\n   at Rubberduck.Parsing.Grammar.VBAParser.startRule() in C:\\Users\\Andrew\\Documents\\GitHub\\Rubberduck\\Rubberduck.Parsing\\Grammar\\VBAParser.cs:line 264\r\n   at Rubberduck.Parsing.VBA.VBAModuleParser.Parse(String moduleName, String moduleCode, IParseTreeListener[] listeners, BaseErrorListener errorListener, ITokenStream& outStream) in C:\\Users\\Andrew\\Documents\\GitHub\\Rubberduck\\Rubberduck.Parsing\\VBA\\VBAModuleParser.cs:line 25\r\n2017-04-08 22:17:12.8821;DEBUG-2.0.14.39296;Rubberduck.Parsing.VBA.RubberduckParserState;Module 'Module2' state is changing to 'Parsed' (thread 20);\r\n```\r\n\r\n**Module 1 - Module level array declaration**\r\n```vb\r\nOption Explicit\r\n\r\nDim Foo1(0 To 3)       As Long\r\n\r\n\r\nSub Test()\r\n'    Dim Foo2(0 To 3)       As Long\r\nEnd Sub\r\n```\r\n\r\n**Trace Log**\r\n```text\r\n2017-04-08 22:24:54.4068;DEBUG-2.0.14.39296;Rubberduck.Parsing.Symbols.SyntaxErrorException;;\r\n2017-04-08 22:24:54.4108;DEBUG-2.0.14.39296;Rubberduck.Parsing.Symbols.SyntaxErrorException;Token: As (L4C24);\r\n2017-04-08 22:24:54.4108;WARN-2.0.14.39296;Rubberduck.Parsing.VBA.VBAModuleParser;SLL mode failed in module Module2. Retrying using LL.;Rubberduck.Parsing.Symbols.SyntaxErrorException: extraneous input 'As' expecting {<EOF>, ':', ATTRIBUTE, BEGIN, CONST, DECLARE, DEFBOOL, DEFBYTE, DEFDATE, DEFDBL, DEFCUR, DEFINT, DEFLNG, DEFLNGLNG, DEFLNGPTR, DEFOBJ, DEFSNG, DEFSTR, DEFVAR, DIM, ENUM, EVENT, FRIEND, FUNCTION, GLOBAL, IMPLEMENTS, OPTION_BASE, OPTION_EXPLICIT, OPTION_COMPARE, OPTION_PRIVATE_MODULE, PRIVATE, PROPERTY_GET, PROPERTY_LET, PROPERTY_SET, PUBLIC, REM, STATIC, SUB, TYPE, VERSION, NEWLINE, ''', WS, LINE_CONTINUATION}\r\n   at Rubberduck.Parsing.Symbols.ExceptionErrorListener.SyntaxError(IRecognizer recognizer, IToken offendingSymbol, Int32 line, Int32 charPositionInLine, String msg, RecognitionException e) in C:\\Users\\Andrew\\Documents\\GitHub\\Rubberduck\\Rubberduck.Parsing\\Symbols\\ExceptionErrorListener.cs:line 10\r\n   at Antlr4.Runtime.ProxyErrorListener`1.SyntaxError(IRecognizer recognizer, Symbol offendingSymbol, Int32 line, Int32 charPositionInLine, String msg, RecognitionException e)\r\n   at Antlr4.Runtime.Parser.NotifyErrorListeners(IToken offendingToken, String msg, RecognitionException e)\r\n   at Antlr4.Runtime.DefaultErrorStrategy.ReportUnwantedToken(Parser recognizer)\r\n   at Antlr4.Runtime.DefaultErrorStrategy.SingleTokenDeletion(Parser recognizer)\r\n   at Antlr4.Runtime.DefaultErrorStrategy.Sync(Parser recognizer)\r\n   at Rubberduck.Parsing.Grammar.VBAParser.endOfStatement() in C:\\Users\\Andrew\\Documents\\GitHub\\Rubberduck\\Rubberduck.Parsing\\Grammar\\VBAParser.cs:line 18521\r\n   at Rubberduck.Parsing.Grammar.VBAParser.moduleDeclarations() in C:\\Users\\Andrew\\Documents\\GitHub\\Rubberduck\\Rubberduck.Parsing\\Grammar\\VBAParser.cs:line 990\r\n   at Rubberduck.Parsing.Grammar.VBAParser.module() in C:\\Users\\Andrew\\Documents\\GitHub\\Rubberduck\\Rubberduck.Parsing\\Grammar\\VBAParser.cs:line 352\r\n   at Rubberduck.Parsing.Grammar.VBAParser.startRule() in C:\\Users\\Andrew\\Documents\\GitHub\\Rubberduck\\Rubberduck.Parsing\\Grammar\\VBAParser.cs:line 264\r\n   at Rubberduck.Parsing.VBA.VBAModuleParser.Parse(String moduleName, String moduleCode, IParseTreeListener[] listeners, BaseErrorListener errorListener, ITokenStream& outStream) in C:\\Users\\Andrew\\Documents\\GitHub\\Rubberduck\\Rubberduck.Parsing\\VBA\\VBAModuleParser.cs:line 25\r\n2017-04-08 22:24:54.4509;DEBUG-2.0.14.39296;Rubberduck.Parsing.Symbols.SyntaxErrorException;;\r\n2017-04-08 22:24:54.4560;DEBUG-2.0.14.39296;Rubberduck.Parsing.Symbols.SyntaxErrorException;Token: As (L3C24);\r\n2017-04-08 22:24:54.4560;WARN-2.0.14.39296;Rubberduck.Parsing.VBA.VBAModuleParser;SLL mode failed in module Module2. Retrying using LL.;Rubberduck.Parsing.Symbols.SyntaxErrorException: extraneous input 'As' expecting {<EOF>, ':', ATTRIBUTE, BEGIN, CONST, DECLARE, DEFBOOL, DEFBYTE, DEFDATE, DEFDBL, DEFCUR, DEFINT, DEFLNG, DEFLNGLNG, DEFLNGPTR, DEFOBJ, DEFSNG, DEFSTR, DEFVAR, DIM, ENUM, EVENT, FRIEND, FUNCTION, GLOBAL, IMPLEMENTS, OPTION_BASE, OPTION_EXPLICIT, OPTION_COMPARE, OPTION_PRIVATE_MODULE, PRIVATE, PROPERTY_GET, PROPERTY_LET, PROPERTY_SET, PUBLIC, REM, STATIC, SUB, TYPE, VERSION, NEWLINE, ''', WS, LINE_CONTINUATION}\r\n   at Rubberduck.Parsing.Symbols.ExceptionErrorListener.SyntaxError(IRecognizer recognizer, IToken offendingSymbol, Int32 line, Int32 charPositionInLine, String msg, RecognitionException e) in C:\\Users\\Andrew\\Documents\\GitHub\\Rubberduck\\Rubberduck.Parsing\\Symbols\\ExceptionErrorListener.cs:line 10\r\n   at Antlr4.Runtime.ProxyErrorListener`1.SyntaxError(IRecognizer recognizer, Symbol offendingSymbol, Int32 line, Int32 charPositionInLine, String msg, RecognitionException e)\r\n   at Antlr4.Runtime.Parser.NotifyErrorListeners(IToken offendingToken, String msg, RecognitionException e)\r\n   at Antlr4.Runtime.DefaultErrorStrategy.ReportUnwantedToken(Parser recognizer)\r\n   at Antlr4.Runtime.DefaultErrorStrategy.SingleTokenDeletion(Parser recognizer)\r\n   at Antlr4.Runtime.DefaultErrorStrategy.Sync(Parser recognizer)\r\n   at Rubberduck.Parsing.Grammar.VBAParser.endOfStatement() in C:\\Users\\Andrew\\Documents\\GitHub\\Rubberduck\\Rubberduck.Parsing\\Grammar\\VBAParser.cs:line 18521\r\n   at Rubberduck.Parsing.Grammar.VBAParser.moduleDeclarations() in C:\\Users\\Andrew\\Documents\\GitHub\\Rubberduck\\Rubberduck.Parsing\\Grammar\\VBAParser.cs:line 990\r\n   at Rubberduck.Parsing.Grammar.VBAParser.module() in C:\\Users\\Andrew\\Documents\\GitHub\\Rubberduck\\Rubberduck.Parsing\\Grammar\\VBAParser.cs:line 352\r\n   at Rubberduck.Parsing.Grammar.VBAParser.startRule() in C:\\Users\\Andrew\\Documents\\GitHub\\Rubberduck\\Rubberduck.Parsing\\Grammar\\VBAParser.cs:line 264\r\n   at Rubberduck.Parsing.VBA.VBAModuleParser.Parse(String moduleName, String moduleCode, IParseTreeListener[] listeners, BaseErrorListener errorListener, ITokenStream& outStream) in C:\\Users\\Andrew\\Documents\\GitHub\\Rubberduck\\Rubberduck.Parsing\\VBA\\VBAModuleParser.cs:line 25\r\n2017-04-08 22:24:54.4911;DEBUG-2.0.14.39296;Rubberduck.Parsing.VBA.RubberduckParserState;Module 'Module2' state is changing to 'Parsed' (thread 36);\r\n```"}}
{"actor":{"display_login":"retailcoder"}}