-
Notifications
You must be signed in to change notification settings - Fork 100
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
Comment support for parser #41
Comments
It's not that there are two different lexers: The parser itself doesn't support comments at all at the moment. Unfortunately I don't have plans to implement it. I'll be happy to accept PRs that do it. |
Based on the phply modifications in tk.phpautodoc, the following code should enable a basic parser with comment support (the line numbers may be wrong, but this should not be a problem at the moment). Currently this modifications are done directly in the existing code, but it probably would be better to use two parsers (one with comment support and one without, as there is an issue comment that a full-blown parser might we overkill in simple situations). I could not yet figure out how to integrate the code to let both parser options work side-by-side - otherwise I probably would already have opened a PR for it.
|
Currently, there seem to be two different lexers: the normal one and a full one (which preserves comments for example). There is only a normal parser, so I would have to use the full lexer if I want to work with the comments later. Having a full parser which supports comments would be easier to use. (Using
parser.parse(infile.read(), lexer=full_lexer.clone())
throws an SyntaxError on<?php
which does not occur when calling afull_lexer.clone()
instance directly without the parser.)The text was updated successfully, but these errors were encountered: