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:
commit
57f1b39cf0
@ -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]
|
||||
|
17
test/fixtures/ruby/hash.diffA-B.txt
vendored
17
test/fixtures/ruby/hash.diffA-B.txt
vendored
@ -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)-})-})-}
|
||||
|
17
test/fixtures/ruby/hash.diffB-A.txt
vendored
17
test/fixtures/ruby/hash.diffB-A.txt
vendored
@ -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)+})+})+}
|
||||
|
17
test/fixtures/ruby/hash.parseA.txt
vendored
17
test/fixtures/ruby/hash.parseA.txt
vendored
@ -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)))
|
||||
|
Loading…
Reference in New Issue
Block a user