Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Expected end of text" Parsing Error #12

Open
atorrrr opened this issue Oct 31, 2016 · 2 comments
Open

"Expected end of text" Parsing Error #12

atorrrr opened this issue Oct 31, 2016 · 2 comments

Comments

@atorrrr
Copy link

atorrrr commented Oct 31, 2016

Getting the "Expected end of text" exception. I am working on running this down myself but figured you might be able to get it done faster.

PARSING VBA CODE:
DEBUG parsed Attribute VB_Name = 'ThisDocument'
DEBUG parsed Attribute VB_Base = '1Normal.ThisDocument'
DEBUG parsed Attribute VB_GlobalNameSpace = False
DEBUG parsed Attribute VB_Creatable = False
DEBUG parsed Attribute VB_PredeclaredId = True
DEBUG parsed Attribute VB_Exposed = True
DEBUG parsed Attribute VB_TemplateDerived = True
DEBUG parsed Attribute VB_Customizable = True
DEBUG parsed Option Explicit
DEBUG parsed Dim "(['DhuBaoK'], {})"
DEBUG parsed LebuGNcc4
DEBUG parsed qLkz_Rm
DEBUG parsed hpwy02E
DEBUG parsed DhuBaoK as SimpleNameExpression
DEBUG parsed LebuGNcc4.Run as SimpleNameExpression
DEBUG parsed Let DhuBaoK = LebuGNcc4.Run
Module 'ThisDocument'

*** PARSING ERROR ***
Function yza5b9ccHV(ByVal LebuGNcc4, ByVal qLkz_Rm, ByVal hpwy02E)
^
Expected end of text (at char 317), (line:12, col:1)

Here is the macro:
macro.txt

@tbearden
Copy link

tbearden commented Nov 5, 2016

Looks like this error is coming from /core/init.py like 120:
m = module.parseString(vba_code, parseAll=True)[0]

See here:
http://stackoverflow.com/questions/7560583/parseexception-expected-end-of-text

Looks like something incomplete with parse strings. Setting parseAll=False, clears the error, but I don't get good results afterwards either.

@decalage2
Copy link
Owner

The current parser is not robust enough, because it tries to parse all the code at once with pyparsing, and it fails whenever there is one statement that it cannot parse completely.
This should be solved with the new line-based parser I'm developing for issue #2, which will be able to ignore individual statements that are not supported yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants