You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am trying to extract all function definitions within a source . I implemented a Listener and implemented fuction enterFuncdef(Python3Parser.FuncdefContext ctx). However, with using ctx.getText() to extract the source block for the function definition, I found out that within the result, all space are skipped after keywords (eg. return abc becomes 'returnabc', for i in list becomes 'foriinlist', ...) but I want to keep the original space within function definition since I need the source code. Is there anything I can do to address this issue?
Thanks a lot!
The text was updated successfully, but these errors were encountered:
Yuxin45
changed the title
FunctionDef Extract using getText()
FunctionDef source extract using getText()
Jul 5, 2021
Hi, I am trying to extract all function definitions within a source . I implemented a Listener and implemented fuction
enterFuncdef(Python3Parser.FuncdefContext ctx).
However, with using ctx.getText() to extract the source block for the function definition, I found out that within the result, all space are skipped after keywords (eg.return abc
becomes 'returnabc',for i in list
becomes 'foriinlist', ...) but I want to keep the original space within function definition since I need the source code. Is there anything I can do to address this issue?Thanks a lot!
The text was updated successfully, but these errors were encountered: