1
1
mirror of https://github.com/github/semantic.git synced 2024-11-24 08:54:07 +03:00

Merge remote-tracking branch 'origin/master' into typescript-cleanup

This commit is contained in:
joshvera 2017-10-02 13:53:41 -07:00
commit 57f1b39cf0
4 changed files with 35 additions and 20 deletions

View File

@ -10,7 +10,7 @@ import Data.Maybe (fromMaybe)
import Data.Record
import Data.Functor (void)
import Data.List.NonEmpty (some1)
import Data.Syntax (postContextualize, emptyTerm, parseError, handleError, infixContext, makeTerm, makeTerm', makeTerm1)
import Data.Syntax (contextualize, postContextualize, emptyTerm, parseError, handleError, infixContext, makeTerm, makeTerm', makeTerm1)
import qualified Data.Syntax as Syntax
import Data.Syntax.Assignment hiding (Assignment, Error)
import qualified Data.Syntax.Assignment as Assignment
@ -401,7 +401,7 @@ invert term = makeTerm <$> location <*> fmap Expression.Not term
-- | Match a term optionally preceded by comment(s), or a sequence of comments if the term is not present.
term :: Assignment -> Assignment
term term = many comment *> term <|> makeTerm1 <$> (Syntax.Context <$> some1 comment <*> emptyTerm)
term term = contextualize comment term <|> makeTerm1 <$> (Syntax.Context <$> some1 comment <*> emptyTerm)
-- | Match a series of terms or comments until a delimiter is matched.
manyTermsTill :: Show b => Assignment.Assignment [] Grammar Term -> Assignment.Assignment [] Grammar b -> Assignment.Assignment [] Grammar [Term]

View File

@ -20,12 +20,17 @@
{-(Integer)-})-})
{-(Hash)-}
{-(Hash
{-(KeyValue
{-(Identifier)-}
{-(Integer)-})-}
{-(KeyValue
{-(TextElement)-}
{-(Integer)-})-}
{-(Context
{-(Comment)-}
{-(KeyValue
{-(Identifier)-}
{-(Integer)-})-})-}
{-(Context
{-(Comment)-}
{-(Comment)-}
{-(KeyValue
{-(TextElement)-}
{-(Integer)-})-})-}
{-(Context
{-(Comment)-}
{-(Empty)-})-})-}

View File

@ -20,12 +20,17 @@
{+(Integer)+})+})
{+(Hash)+}
{+(Hash
{+(KeyValue
{+(Identifier)+}
{+(Integer)+})+}
{+(KeyValue
{+(TextElement)+}
{+(Integer)+})+}
{+(Context
{+(Comment)+}
{+(KeyValue
{+(Identifier)+}
{+(Integer)+})+})+}
{+(Context
{+(Comment)+}
{+(Comment)+}
{+(KeyValue
{+(TextElement)+}
{+(Integer)+})+})+}
{+(Context
{+(Comment)+}
{+(Empty)+})+})+}

View File

@ -14,12 +14,17 @@
(Integer)))
(Hash)
(Hash
(KeyValue
(Identifier)
(Integer))
(KeyValue
(TextElement)
(Integer))
(Context
(Comment)
(KeyValue
(Identifier)
(Integer)))
(Context
(Comment)
(Comment)
(KeyValue
(TextElement)
(Integer)))
(Context
(Comment)
(Empty)))