1
1
mirror of https://github.com/github/semantic.git synced 2024-12-19 12:51:52 +03:00

Define a helper to contextualize infix terms.

This commit is contained in:
Rob Rix 2017-08-14 16:56:40 -04:00
parent 27f4db2f6a
commit dfbe85e5a0

View File

@ -13,7 +13,7 @@ import Data.Functor.Classes.Eq.Generic
import Data.Functor.Classes.Show.Generic import Data.Functor.Classes.Show.Generic
import Data.Maybe (fromMaybe) import Data.Maybe (fromMaybe)
import Data.Record import Data.Record
import Data.Syntax (contextualize, emptyTerm, handleError, makeTerm, makeTerm', makeTerm1) import Data.Syntax (contextualize, emptyTerm, handleError, infixContext, makeTerm, makeTerm', makeTerm1)
import qualified Data.Syntax as Syntax import qualified Data.Syntax as Syntax
import Data.Syntax.Assignment hiding (Assignment, Error) import Data.Syntax.Assignment hiding (Assignment, Error)
import qualified Data.Syntax.Assignment as Assignment import qualified Data.Syntax.Assignment as Assignment
@ -471,3 +471,10 @@ conditionalExpression = makeTerm <$> symbol ConditionalExpression <*> children (
term :: Assignment -> Assignment term :: Assignment -> Assignment
term = contextualize comment term = contextualize comment
infixTerm :: HasCallStack
=> Assignment
-> Assignment
-> [Assignment.Assignment (AST Grammar) Grammar (Term -> Term -> Union Syntax Term)]
-> Assignment.Assignment (AST Grammar) Grammar (Union Syntax Term)
infixTerm = infixContext comment