mirror of
https://github.com/github/semantic.git
synced 2024-12-29 18:06:14 +03:00
Define & export Python and Ruby Error types.
This commit is contained in:
parent
0d71b2f23b
commit
58c1afebe5
@ -4,6 +4,7 @@ module Language.Python.Syntax
|
||||
, Syntax
|
||||
, Syntax'
|
||||
, Grammar
|
||||
, Error
|
||||
) where
|
||||
|
||||
import Data.Align.Generic
|
||||
@ -11,7 +12,8 @@ import Data.Functor.Classes.Eq.Generic
|
||||
import Data.Functor.Classes.Show.Generic
|
||||
import Data.Functor.Union
|
||||
import qualified Data.Syntax as Syntax
|
||||
import Data.Syntax.Assignment
|
||||
import Data.Syntax.Assignment hiding (Error)
|
||||
import qualified Data.Syntax.Assignment as Assignment
|
||||
import qualified Data.Syntax.Comment as Comment
|
||||
import qualified Data.Syntax.Declaration as Declaration
|
||||
import qualified Data.Syntax.Expression as Expression
|
||||
@ -45,11 +47,13 @@ type Syntax' =
|
||||
, Statement.Return
|
||||
, Statement.Yield
|
||||
, Syntax.Empty
|
||||
, Syntax.Error [Error Grammar]
|
||||
, Syntax.Error [Error]
|
||||
, Syntax.Identifier
|
||||
, []
|
||||
]
|
||||
|
||||
type Error = Assignment.Error Grammar
|
||||
|
||||
data Redirect a = Redirect !a !a
|
||||
deriving (Eq, Foldable, Functor, GAlign, Generic1, Show, Traversable)
|
||||
|
||||
|
@ -4,11 +4,13 @@ module Language.Ruby.Syntax
|
||||
, Syntax
|
||||
, Syntax'
|
||||
, Grammar
|
||||
, Error
|
||||
) where
|
||||
|
||||
import Data.Functor.Union
|
||||
import qualified Data.Syntax as Syntax
|
||||
import Data.Syntax.Assignment
|
||||
import Data.Syntax.Assignment hiding (Error)
|
||||
import qualified Data.Syntax.Assignment as Assignment
|
||||
import qualified Data.Syntax.Comment as Comment
|
||||
import qualified Data.Syntax.Declaration as Declaration
|
||||
import qualified Data.Syntax.Expression as Expression
|
||||
@ -46,11 +48,13 @@ type Syntax' =
|
||||
, Statement.While
|
||||
, Statement.Yield
|
||||
, Syntax.Empty
|
||||
, Syntax.Error [Error Grammar]
|
||||
, Syntax.Error [Error]
|
||||
, Syntax.Identifier
|
||||
, []
|
||||
]
|
||||
|
||||
type Error = Assignment.Error Grammar
|
||||
|
||||
|
||||
-- | Assignment from AST in Ruby’s grammar onto a program in Ruby’s syntax.
|
||||
assignment :: HasCallStack => Assignment (Node Grammar) (Term Syntax Location)
|
||||
|
Loading…
Reference in New Issue
Block a user