{"action":"created","issue":{"url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/issues/2870","repository_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck","labels_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/issues/2870/labels{/name}","comments_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/issues/2870/comments","events_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/issues/2870/events","html_url":"https://github.com/rubberduck-vba/Rubberduck/issues/2870","id":214227541,"number":2870,"title":"False positive of \"extraneous input\" due to RaiseEvent","user":{"login":"bclothier","id":2367644,"avatar_url":"https://avatars1.githubusercontent.com/u/2367644?v=3","gravatar_id":"","url":"https://api.github.com/users/bclothier","html_url":"https://github.com/bclothier","followers_url":"https://api.github.com/users/bclothier/followers","following_url":"https://api.github.com/users/bclothier/following{/other_user}","gists_url":"https://api.github.com/users/bclothier/gists{/gist_id}","starred_url":"https://api.github.com/users/bclothier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bclothier/subscriptions","organizations_url":"https://api.github.com/users/bclothier/orgs","repos_url":"https://api.github.com/users/bclothier/repos","events_url":"https://api.github.com/users/bclothier/events{/privacy}","received_events_url":"https://api.github.com/users/bclothier/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":202428759,"url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/labels/critical","name":"critical","color":"b60205","default":false},{"id":175554363,"url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/labels/parse-tree-processing","name":"parse-tree-processing","color":"DDDDDD","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-03-14T22:37:00Z","updated_at":"2017-03-14T23:03:44Z","closed_at":null,"body":"I have a complex procedure that is causing a parser error.\r\n\r\nThe offending line is simply this:\r\n\r\n            mFrmQueue.RecordSource = strSQL\r\n\r\nand it reports `extraneous input 'strSQL' expecting {')', WS, LINE_CONTINUATION}`.\r\n\r\nFew things that raise red flags:\r\n\r\nIt reports the error being located at the line 313, on column 52. This is the correct line but the end of the line (after the `strSQL`) is at column 40. Hmm....\r\n\r\nCommenting out this line _stills_ results in a parse error\r\n\r\nDeleting the lines and pasting it back -> parse error\r\nTyping the whole line by hand -> parse error\r\nCommenting the entire body of the procedure -> no more parse error\r\nCopy'n'paste the entire body of the procedure -> error parse again. (I used Immediate windows which normally would strip out any unprintable characters).\r\n\r\nThe procedure does not contain any hidden instructions like `VB_Attribute` or anything of that sort. \r\n\r\nWhile writing the bug report, I found a piece of clue -- if I comment the `RaiseEvent` line, no more parse error.... So it seems to be related to the raiseevent somehow.\r\n\r\n    'Several lines of code...\r\n    RaiseEvent FilterQueue(bolDoNotContinue, ByVal strSQL, colSpecials)\r\n\r\n    If bolDoNotContinue = False Then\r\n        If Len(strSQL) Then\r\n            strSQL = \"WHERE \" & strSQL\r\n        End If\r\n        strOrigSQL = mFrmQueue.RecordSource\r\n        strSQL = ReplaceWhereClause(strOrigSQL, strSQL)\r\n        mFrmQueue.RecordSource = strSQL\r\n        On Error Resume Next\r\n        If Err.Number Then\r\n            lngError = Err.Number\r\n            strError = Err.Description & \", (\" & Err.Source & \")\"\r\n            mFrmQueue.RecordSource = strOrigSQL\r\n        End If\r\n        On Error GoTo 0\r\n        If lngError Then\r\n            Err.Raise lngError, mconstrModuleName, \"Cannot perform ApplyFilters due to error: \" & vbNewLine & strError\r\n        End If\r\n    End If\r\n\r\nI verified that even if I commented everything else leaving only the `RaiseEvent` in the code, I get an parse error. Comment out only the `RaiseEvent`, it parses OK. So it looks like RaiseEvent is causing this problem somehow and this cascades to subsequent lines.\r\n\r\nIn case it matters... the definition of event is...\r\n\r\n    Public Event FilterQueue(ByRef Cancel As Boolean, ByVal SQLWhereClause As String, ByRef UnprocessedControls As VBA.Collection)\r\n"},"comment":{"url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/issues/comments/286589062","html_url":"https://github.com/rubberduck-vba/Rubberduck/issues/2870#issuecomment-286589062","issue_url":"https://api.github.com/repos/rubberduck-vba/Rubberduck/issues/2870","id":286589062,"user":{"login":"retailcoder","id":5751684,"avatar_url":"https://avatars1.githubusercontent.com/u/5751684?v=3","gravatar_id":"","url":"https://api.github.com/users/retailcoder","html_url":"https://github.com/retailcoder","followers_url":"https://api.github.com/users/retailcoder/followers","following_url":"https://api.github.com/users/retailcoder/following{/other_user}","gists_url":"https://api.github.com/users/retailcoder/gists{/gist_id}","starred_url":"https://api.github.com/users/retailcoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/retailcoder/subscriptions","organizations_url":"https://api.github.com/users/retailcoder/orgs","repos_url":"https://api.github.com/users/retailcoder/repos","events_url":"https://api.github.com/users/retailcoder/events{/privacy}","received_events_url":"https://api.github.com/users/retailcoder/received_events","type":"User","site_admin":false},"created_at":"2017-03-14T23:03:44Z","updated_at":"2017-03-14T23:03:44Z","body":"Can you export the module and show us what you see on (313,52)? I suspect the parser error occurred while pre-processing / collecting module & member attributes. Parser tokens are otherwise exactly aligned with what's in the code panes."}}
{"actor":{"display_login":"retailcoder"}}