summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilFreeman <>2015-03-18 17:31:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2015-03-18 17:31:00 (GMT)
commit1631e68f891ac05afd312f1d4d65a50a65922820 (patch)
tree717e3a4b908f24e30260604d56c9217d4c19f13e
parente974680c28b9812407c959bbe5f16369a30e553f (diff)
version 0.6.9.30.6.9.3
-rw-r--r--psc-docs/Ctags.hs (renamed from psc-docs/CTags.hs)0
-rw-r--r--psc-docs/Etags.hs (renamed from psc-docs/ETags.hs)0
-rw-r--r--psc-docs/Tags.hs18
-rw-r--r--purescript.cabal7
4 files changed, 22 insertions, 3 deletions
diff --git a/psc-docs/CTags.hs b/psc-docs/Ctags.hs
index 3635534..3635534 100644
--- a/psc-docs/CTags.hs
+++ b/psc-docs/Ctags.hs
diff --git a/psc-docs/ETags.hs b/psc-docs/Etags.hs
index cb3c98c..cb3c98c 100644
--- a/psc-docs/ETags.hs
+++ b/psc-docs/Etags.hs
diff --git a/psc-docs/Tags.hs b/psc-docs/Tags.hs
new file mode 100644
index 0000000..9f8294e
--- /dev/null
+++ b/psc-docs/Tags.hs
@@ -0,0 +1,18 @@
+module Tags where
+
+import qualified Language.PureScript as P
+
+tags :: P.Module -> [(String, Int)]
+tags = concatMap dtags . P.exportedDeclarations
+ where dtags (P.PositionedDeclaration sp _ d) = map tag $ names d
+ where tag name = (name, line)
+ line = P.sourcePosLine $ P.spanStart sp
+ dtags _ = []
+ names (P.DataDeclaration _ name _ dcons) = P.runProperName name : consNames
+ where consNames = map (\(cname, _) -> P.runProperName cname) dcons
+ names (P.TypeDeclaration ident _) = [show ident]
+ names (P.ExternDeclaration _ ident _ _) = [show ident]
+ names (P.TypeSynonymDeclaration name _ _) = [P.runProperName name]
+ names (P.TypeClassDeclaration name _ _ _) = [P.runProperName name]
+ names (P.TypeInstanceDeclaration name _ _ _ _) = [show name]
+ names _ = []
diff --git a/purescript.cabal b/purescript.cabal
index 6e121ec..588bcef 100644
--- a/purescript.cabal
+++ b/purescript.cabal
@@ -1,5 +1,5 @@
name: purescript
-version: 0.6.9.2
+version: 0.6.9.3
cabal-version: >=1.8
build-type: Simple
license: MIT
@@ -160,8 +160,9 @@ executable psc-docs
main-is: Main.hs
buildable: True
hs-source-dirs: psc-docs
- other-modules: CTags
- ETags
+ other-modules: Ctags
+ Etags
+ Tags
ghc-options: -Wall -O2
executable psc-hierarchy