Rename HasComments to Comment; remove *.cabal
This commit is contained in:
parent
e701e196fe
commit
19f05f5afc
1
.gitignore
vendored
1
.gitignore
vendored
@ -33,3 +33,4 @@ nix/result
|
|||||||
.idea
|
.idea
|
||||||
*.iml
|
*.iml
|
||||||
stale_outputs_checked
|
stale_outputs_checked
|
||||||
|
*.cabal
|
||||||
|
@ -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
|
|
@ -16,10 +16,10 @@ import Union
|
|||||||
|
|
||||||
ranged
|
ranged
|
||||||
:: ( Functor f
|
:: ( Functor f
|
||||||
, Member f fs
|
, Member f fs
|
||||||
)
|
)
|
||||||
=> Parser (f (Tree fs ASTInfo))
|
=> Parser (f (Tree fs ASTInfo))
|
||||||
-> Parser (Tree fs ASTInfo)
|
-> Parser (Tree fs ASTInfo)
|
||||||
ranged p = do
|
ranged p = do
|
||||||
r <- getInfo
|
r <- getInfo
|
||||||
a <- p
|
a <- p
|
||||||
@ -46,8 +46,8 @@ declaration
|
|||||||
= do ranged do pure ValueDecl <*> binding
|
= do ranged do pure ValueDecl <*> binding
|
||||||
<|> do ranged do pure ValueDecl <*> vardecl
|
<|> do ranged do pure ValueDecl <*> vardecl
|
||||||
<|> do ranged do pure ValueDecl <*> constdecl
|
<|> do ranged do pure ValueDecl <*> constdecl
|
||||||
|
<|> do ranged do pure Action <*> attributes
|
||||||
<|> do typedecl
|
<|> do typedecl
|
||||||
<|> do ranged do pure Action <*> attributes
|
|
||||||
<|> do include
|
<|> do include
|
||||||
|
|
||||||
include :: Parser (Pascal ASTInfo)
|
include :: Parser (Pascal ASTInfo)
|
||||||
|
@ -29,7 +29,7 @@ import Parser
|
|||||||
import Range
|
import Range
|
||||||
import AST.Types
|
import AST.Types
|
||||||
import Tree
|
import Tree
|
||||||
import HasComments
|
import Comment
|
||||||
import Pretty
|
import Pretty
|
||||||
|
|
||||||
-- | Scope-holding monad.
|
-- | Scope-holding monad.
|
||||||
|
@ -37,15 +37,15 @@ data Declaration it
|
|||||||
deriving stock (Functor, Foldable, Traversable)
|
deriving stock (Functor, Foldable, Traversable)
|
||||||
|
|
||||||
data Binding it
|
data Binding it
|
||||||
= Irrefutable it it -- ^ (Pattern) (Expr)
|
= Irrefutable it it -- ^ (Pattern) (Expr)
|
||||||
| Function Bool it [it] it it -- ^ (Name) [VarDecl] (Type) (Expr)
|
| Function Bool it [it] it it -- ^ (Name) [VarDecl] (Type) (Expr)
|
||||||
| Var it it it -- ^ (Name) (Type) (Expr)
|
| Var it it it -- ^ (Name) (Type) (Expr)
|
||||||
| Const it it it -- ^ (Name) (Type) (Expr)
|
| Const it it it -- ^ (Name) (Type) (Expr)
|
||||||
deriving (Show) via PP (Binding it)
|
deriving (Show) via PP (Binding it)
|
||||||
deriving stock (Functor, Foldable, Traversable)
|
deriving stock (Functor, Foldable, Traversable)
|
||||||
|
|
||||||
data VarDecl it
|
data VarDecl it
|
||||||
= Decl it it it -- ^ (Mutable) (Name) (Type)
|
= Decl it it it -- ^ (Mutable) (Name) (Type)
|
||||||
deriving (Show) via PP (VarDecl it)
|
deriving (Show) via PP (VarDecl it)
|
||||||
deriving stock (Functor, Foldable, Traversable)
|
deriving stock (Functor, Foldable, Traversable)
|
||||||
|
|
||||||
@ -57,22 +57,22 @@ data Mutable it
|
|||||||
|
|
||||||
|
|
||||||
data Type it
|
data Type it
|
||||||
= TArrow it it -- ^ (Type) (Type)
|
= TArrow it it -- ^ (Type) (Type)
|
||||||
| TRecord [it] -- ^ [TField]
|
| TRecord [it] -- ^ [TField]
|
||||||
| TVar it -- ^ (Name)
|
| TVar it -- ^ (Name)
|
||||||
| TSum [it] -- ^ [Variant]
|
| TSum [it] -- ^ [Variant]
|
||||||
| TProduct [it] -- ^ [Type]
|
| TProduct [it] -- ^ [Type]
|
||||||
| TApply it [it] -- (Name) [Type]
|
| TApply it [it] -- (Name) [Type]
|
||||||
deriving (Show) via PP (Type it)
|
deriving (Show) via PP (Type it)
|
||||||
deriving stock (Functor, Foldable, Traversable)
|
deriving stock (Functor, Foldable, Traversable)
|
||||||
|
|
||||||
data Variant it
|
data Variant it
|
||||||
= Variant it (Maybe it) -- (Name) (Maybe (Type))
|
= Variant it (Maybe it) -- (Name) (Maybe (Type))
|
||||||
deriving (Show) via PP (Variant it)
|
deriving (Show) via PP (Variant it)
|
||||||
deriving stock (Functor, Foldable, Traversable)
|
deriving stock (Functor, Foldable, Traversable)
|
||||||
|
|
||||||
data TField it
|
data TField it
|
||||||
= TField it it -- (Name) (Type)
|
= TField it it -- (Name) (Type)
|
||||||
deriving (Show) via PP (TField it)
|
deriving (Show) via PP (TField it)
|
||||||
deriving stock (Functor, Foldable, Traversable)
|
deriving stock (Functor, Foldable, Traversable)
|
||||||
|
|
||||||
@ -97,12 +97,12 @@ data Expr it
|
|||||||
| MapRemove it it -- (Expr) (QualifiedName)
|
| MapRemove it it -- (Expr) (QualifiedName)
|
||||||
| SetRemove it it -- (Expr) (QualifiedName)
|
| SetRemove it it -- (Expr) (QualifiedName)
|
||||||
| Indexing it it -- (QualifiedName) (Expr)
|
| Indexing it it -- (QualifiedName) (Expr)
|
||||||
| Case it [it] -- (Expr) [Alt]
|
| Case it [it] -- (Expr) [Alt]
|
||||||
| Skip
|
| Skip
|
||||||
| ForLoop it it it it -- (Name) (Expr) (Expr) (Expr)
|
| ForLoop it it it it -- (Name) (Expr) (Expr) (Expr)
|
||||||
| WhileLoop it it -- (Expr) (Expr)
|
| WhileLoop it it -- (Expr) (Expr)
|
||||||
| Seq [it] -- [Declaration]
|
| Seq [it] -- [Declaration]
|
||||||
| Lambda [it] it it -- [VarDecl] (Type) (Expr)
|
| Lambda [it] it it -- [VarDecl] (Type) (Expr)
|
||||||
| ForBox it (Maybe it) Text it it -- (Name) (Maybe (Name)) Text (Expr) (Expr)
|
| ForBox it (Maybe it) Text it it -- (Name) (Maybe (Name)) Text (Expr) (Expr)
|
||||||
| MapPatch it [it] -- (QualifiedName) [MapBinding]
|
| MapPatch it [it] -- (QualifiedName) [MapBinding]
|
||||||
| SetPatch it [it] -- (QualifiedName) [Expr]
|
| SetPatch it [it] -- (QualifiedName) [Expr]
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
{- | Comments and utilities.
|
{- | Comments and utilities.
|
||||||
-}
|
-}
|
||||||
|
|
||||||
module HasComments
|
module Comment
|
||||||
( HasComments(..)
|
( HasComments(..)
|
||||||
, c
|
, c
|
||||||
)
|
)
|
@ -76,7 +76,7 @@ import qualified Data.Text as Text
|
|||||||
import ParseTree
|
import ParseTree
|
||||||
import Range
|
import Range
|
||||||
import Pretty
|
import Pretty
|
||||||
import HasComments
|
import Comment
|
||||||
import Error
|
import Error
|
||||||
|
|
||||||
import Debug.Trace
|
import Debug.Trace
|
||||||
|
@ -29,7 +29,7 @@ import Data.Foldable
|
|||||||
|
|
||||||
import Union
|
import Union
|
||||||
import Lattice
|
import Lattice
|
||||||
import HasComments
|
import Comment
|
||||||
import Pretty
|
import Pretty
|
||||||
import Error
|
import Error
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user