Rename HasComments to Comment; remove *.cabal

This commit is contained in:
Kirill Andreev 2020-06-04 19:15:14 +04:00
parent e701e196fe
commit 19f05f5afc
No known key found for this signature in database
GPG Key ID: CF7DA79DE4785A47
8 changed files with 26 additions and 99 deletions

1
.gitignore vendored
View File

@ -33,3 +33,4 @@ nix/result
.idea
*.iml
stale_outputs_checked
*.cabal

View File

@ -1,74 +0,0 @@
cabal-version: 1.12
-- This file has been generated from package.yaml by hpack version 0.33.0.
--
-- see: https://github.com/sol/hpack
--
-- hash: 0561ca5eedeec178effcd82246fe314b488637ceea34ea241eb4943714bdb7aa
name: squirrel
version: 0.0.0
build-type: Simple
library
exposed-modules:
AST
AST.Parser
AST.Scope
AST.Types
Error
HasComments
Lattice
Parser
ParseTree
Pretty
Range
Tree
Union
other-modules:
Paths_squirrel
hs-source-dirs:
src/
default-extensions: BangPatterns BlockArguments DataKinds DeriveFoldable DeriveFunctor DeriveTraversable DerivingStrategies DerivingVia FlexibleContexts FlexibleInstances GADTs GeneralisedNewtypeDeriving LambdaCase MultiParamTypeClasses NamedFieldPuns OverloadedStrings QuasiQuotes ScopedTypeVariables StandaloneDeriving TemplateHaskell TypeFamilies TypeOperators UndecidableInstances FunctionalDependencies ViewPatterns
ghc-options: -freverse-errors -Wall -threaded
include-dirs:
vendor
c-sources:
vendor/parser.c
build-depends:
base
, bytestring
, data-default
, data-fix
, mtl
, pretty
, template-haskell
, text
, tree-sitter
default-language: Haskell2010
executable squirrel
main-is: Main.hs
other-modules:
Paths_squirrel
hs-source-dirs:
app/
default-extensions: BangPatterns BlockArguments DataKinds DeriveFoldable DeriveFunctor DeriveTraversable DerivingStrategies DerivingVia FlexibleContexts FlexibleInstances GADTs GeneralisedNewtypeDeriving LambdaCase MultiParamTypeClasses NamedFieldPuns OverloadedStrings QuasiQuotes ScopedTypeVariables StandaloneDeriving TemplateHaskell TypeFamilies TypeOperators UndecidableInstances FunctionalDependencies ViewPatterns
ghc-options: -freverse-errors -Wall -threaded
build-depends:
base
, bytestring
, data-default
, data-fix
, haskell-lsp
, hslogger
, interpolate
, lens
, mtl
, pretty
, squirrel
, stm
, template-haskell
, text
, tree-sitter
default-language: Haskell2010

View File

@ -16,10 +16,10 @@ import Union
ranged
:: ( Functor f
, Member f fs
, Member f fs
)
=> Parser (f (Tree fs ASTInfo))
-> Parser (Tree fs ASTInfo)
-> Parser (Tree fs ASTInfo)
ranged p = do
r <- getInfo
a <- p
@ -46,8 +46,8 @@ declaration
= do ranged do pure ValueDecl <*> binding
<|> do ranged do pure ValueDecl <*> vardecl
<|> do ranged do pure ValueDecl <*> constdecl
<|> do ranged do pure Action <*> attributes
<|> do typedecl
<|> do ranged do pure Action <*> attributes
<|> do include
include :: Parser (Pascal ASTInfo)

View File

@ -29,7 +29,7 @@ import Parser
import Range
import AST.Types
import Tree
import HasComments
import Comment
import Pretty
-- | Scope-holding monad.

View File

@ -37,15 +37,15 @@ data Declaration it
deriving stock (Functor, Foldable, Traversable)
data Binding it
= Irrefutable it it -- ^ (Pattern) (Expr)
| Function Bool it [it] it it -- ^ (Name) [VarDecl] (Type) (Expr)
| Var it it it -- ^ (Name) (Type) (Expr)
| Const it it it -- ^ (Name) (Type) (Expr)
= Irrefutable it it -- ^ (Pattern) (Expr)
| Function Bool it [it] it it -- ^ (Name) [VarDecl] (Type) (Expr)
| Var it it it -- ^ (Name) (Type) (Expr)
| Const it it it -- ^ (Name) (Type) (Expr)
deriving (Show) via PP (Binding it)
deriving stock (Functor, Foldable, Traversable)
data VarDecl it
= Decl it it it -- ^ (Mutable) (Name) (Type)
= Decl it it it -- ^ (Mutable) (Name) (Type)
deriving (Show) via PP (VarDecl it)
deriving stock (Functor, Foldable, Traversable)
@ -57,22 +57,22 @@ data Mutable it
data Type it
= TArrow it it -- ^ (Type) (Type)
| TRecord [it] -- ^ [TField]
| TVar it -- ^ (Name)
| TSum [it] -- ^ [Variant]
| TProduct [it] -- ^ [Type]
| TApply it [it] -- (Name) [Type]
= TArrow it it -- ^ (Type) (Type)
| TRecord [it] -- ^ [TField]
| TVar it -- ^ (Name)
| TSum [it] -- ^ [Variant]
| TProduct [it] -- ^ [Type]
| TApply it [it] -- (Name) [Type]
deriving (Show) via PP (Type it)
deriving stock (Functor, Foldable, Traversable)
data Variant it
= Variant it (Maybe it) -- (Name) (Maybe (Type))
= Variant it (Maybe it) -- (Name) (Maybe (Type))
deriving (Show) via PP (Variant it)
deriving stock (Functor, Foldable, Traversable)
data TField it
= TField it it -- (Name) (Type)
= TField it it -- (Name) (Type)
deriving (Show) via PP (TField it)
deriving stock (Functor, Foldable, Traversable)
@ -97,12 +97,12 @@ data Expr it
| MapRemove it it -- (Expr) (QualifiedName)
| SetRemove it it -- (Expr) (QualifiedName)
| Indexing it it -- (QualifiedName) (Expr)
| Case it [it] -- (Expr) [Alt]
| Case it [it] -- (Expr) [Alt]
| Skip
| ForLoop it it it it -- (Name) (Expr) (Expr) (Expr)
| WhileLoop it it -- (Expr) (Expr)
| Seq [it] -- [Declaration]
| Lambda [it] it it -- [VarDecl] (Type) (Expr)
| ForLoop it it it it -- (Name) (Expr) (Expr) (Expr)
| WhileLoop it it -- (Expr) (Expr)
| Seq [it] -- [Declaration]
| Lambda [it] it it -- [VarDecl] (Type) (Expr)
| ForBox it (Maybe it) Text it it -- (Name) (Maybe (Name)) Text (Expr) (Expr)
| MapPatch it [it] -- (QualifiedName) [MapBinding]
| SetPatch it [it] -- (QualifiedName) [Expr]

View File

@ -2,7 +2,7 @@
{- | Comments and utilities.
-}
module HasComments
module Comment
( HasComments(..)
, c
)

View File

@ -76,7 +76,7 @@ import qualified Data.Text as Text
import ParseTree
import Range
import Pretty
import HasComments
import Comment
import Error
import Debug.Trace

View File

@ -29,7 +29,7 @@ import Data.Foldable
import Union
import Lattice
import HasComments
import Comment
import Pretty
import Error