1
1
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:
joshvera 2020-01-08 13:13:48 -05:00
parent 2ec9dc5595
commit 6ff8abbe41
2 changed files with 14 additions and 1 deletions

View File

@ -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)

View File

@ -65,6 +65,7 @@ executable python-graph
build-depends: base
, semantic-python
, semantic-scope-graph
, bytestring
test-suite test
import: haskell