FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
CodeSearchNet/function_parser/function_parser/parser_cli.py at master · mloncode/CodeSearchNet · GitHub
mloncode
/
CodeSearchNet
Public
forked from
github/CodeSearchNet
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
CodeSearchNet
/
function_parser
/
function_parser
/
parser_cli.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
25 lines (19 loc) · 746 Bytes
Breadcrumbs
CodeSearchNet
/
function_parser
/
function_parser
/
parser_cli.py
Copy path
File metadata and controls
25 lines (19 loc) · 746 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
"""
Usage:
parser_cli.py [options] INPUT_FILEPATH
Options:
-h --help
--language LANGUAGE Language
"""
import
json
from
docopt
import
docopt
from
tree_sitter
import
Language
from
language_data
import
LANGUAGE_METADATA
from
process
import
DataProcessor
if
__name__
==
'__main__'
:
args
=
docopt
(
__doc__
)
DataProcessor
.
PARSER
.
set_language
(
Language
(
'/src/build/py-tree-sitter-languages.so'
,
args
[
'--language'
]))
processor
=
DataProcessor
(
language
=
args
[
'--language'
],
language_parser
=
LANGUAGE_METADATA
[
args
[
'--language'
]][
'language_parser'
])
functions
=
processor
.
process_single_file
(
args
[
'INPUT_FILEPATH'
])
print
(
json
.
dumps
(
functions
,
indent
=
2
))
Back
|
FazBrowse Home
|
New Git URL