-
Notifications
You must be signed in to change notification settings - Fork 29
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
Add debugging level where walkCst emits CST tree printy-printed #10
Comments
dumpCst as enhanced now makes this obsolete? Now they both do the same thing but I like dumpCst better as one doesn't have to switch on the print stmt inside walkCst. I think I meant to say in my comment that the print stmt inside walkCst is still useful as one can turn it on to see exactly where the processing breaks. But printCst as a function is no longer needed. |
I am not sure it makes it obsolete, as you wrote it does let you see exactly where in the processing it breaks. I'll get to this one a bit later. |
printCst function turns off processing so it will print the whole cst regardless (which is also what dumpCst does). What we need is a debug flag that lets you print while processing so you can see when processing stops. What would be really cool is to save some of the processing history in a (circular) buffer that can then be auto dumped whenever the assertion exception is raised! But that would be a feature that would hopefully be rarely needed unless you plan a lot more work on pycscope. And if you do plan on a lot more features to come I really think you should take a look at the AST grammar. |
What features are you thinking about that would require the Abstract Syntax Tree to get correctly? |
Obviously anything that can be done in AST can also be done in CST so it is stmt = FunctionDef(identifier name, arguments args, So you immediately get Assign/AugAssign. Then you look at expr: expr = BoolOp(boolop op, expr* values) You have Call/Attribute/Subscript/Name/Tuple ... all given to you with the I agree if the current cst decoding is working well there is no need for On Wed, Sep 19, 2012 at 9:31 PM, Peter Portante [email protected]:
|
The requirement for cscope is that every line of a source file that has a symbol on it appears in the cscope database. If the AST can provide that, than it can be used in place of the CST. That said, retooling to use AST seems like a lot of work, so I would only suggest we engage in that effort if there is a feature that would benefit from it. Do you have any in mind? |
Feature wise I am happy with the way it is. I am also no expert on cscope On Thu, Sep 20, 2012 at 5:03 PM, Peter Portante [email protected]:
|
From Free Speech:
The text was updated successfully, but these errors were encountered: