1
1
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:
Rob Rix 2017-06-05 15:47:55 -04:00
parent 0d71b2f23b
commit 58c1afebe5
2 changed files with 12 additions and 4 deletions

View File

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

View File

@ -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 Rubys grammar onto a program in Rubys syntax.
assignment :: HasCallStack => Assignment (Node Grammar) (Term Syntax Location)