Новый раг
This commit is contained in:
11
app/modules/rag/indexing/code/symbols/ast_parser.py
Normal file
11
app/modules/rag/indexing/code/symbols/ast_parser.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import ast
|
||||
|
||||
|
||||
class PythonAstParser:
|
||||
def parse_module(self, text: str) -> ast.AST | None:
|
||||
try:
|
||||
return ast.parse(text)
|
||||
except SyntaxError:
|
||||
return None
|
||||
Reference in New Issue
Block a user