mirror of
https://github.com/github/semantic.git
synced 2024-11-28 10:15:55 +03:00
spit out a python tree
Co-Authored-By: Patrick Thomson <patrickt@users.noreply.github.com>
This commit is contained in:
parent
2ec9dc5595
commit
6ff8abbe41
@ -1,4 +1,16 @@
|
||||
{-# LANGUAGE OverloadedStrings, ScopedTypeVariables, TypeApplications, TypeOperators #-}
|
||||
module Main (main) where
|
||||
|
||||
import qualified Data.ByteString as ByteString
|
||||
import Language.Python.ScopeGraph
|
||||
import qualified TreeSitter.Python.AST as Py
|
||||
import qualified TreeSitter.Python as TSP
|
||||
import qualified TreeSitter.Unmarshal as TS
|
||||
import Source.Span
|
||||
import Source.Range
|
||||
|
||||
main :: IO ()
|
||||
main = putStrLn "hell world"
|
||||
main = do
|
||||
file <- ByteString.readFile "semantic-python/test/fixtures/1-01-empty-module.py"
|
||||
tree <- TS.parseByteString @Py.Module @(Range, Span) TSP.tree_sitter_python file
|
||||
print (show tree)
|
||||
|
@ -65,6 +65,7 @@ executable python-graph
|
||||
build-depends: base
|
||||
, semantic-python
|
||||
, semantic-scope-graph
|
||||
, bytestring
|
||||
|
||||
test-suite test
|
||||
import: haskell
|
||||
|
Loading…
Reference in New Issue
Block a user