mirror of
https://github.com/github/semantic.git
synced 2024-12-19 04:41:47 +03:00
Merge branch 'master' into method-call-improvements
This commit is contained in:
commit
b86b3218dc
@ -14,6 +14,8 @@ data Category
|
||||
| Error
|
||||
-- | A boolean expression.
|
||||
| Boolean
|
||||
-- | A bitwise operator.
|
||||
| BitwiseOperator
|
||||
-- | An operator with 2 operands.
|
||||
| BinaryOperator
|
||||
-- | A literal key-value data structure.
|
||||
|
@ -172,6 +172,7 @@ instance HasCategory Category where
|
||||
toCategoryName = \case
|
||||
ArrayLiteral -> "array"
|
||||
BinaryOperator -> "binary operator"
|
||||
BitwiseOperator -> "bitwise operator"
|
||||
Boolean -> "boolean"
|
||||
DictionaryLiteral -> "dictionary"
|
||||
C.Comment -> "comment"
|
||||
|
@ -19,7 +19,7 @@ type Parser f a = SourceBlob -> IO (Cofree f a)
|
||||
|
||||
-- | Whether a category is an Operator Category
|
||||
isOperator :: Category -> Bool
|
||||
isOperator = flip Set.member (Set.fromList [ Operator, BinaryOperator ])
|
||||
isOperator = flip Set.member (Set.fromList [ Operator, BinaryOperator, BitwiseOperator ])
|
||||
|
||||
-- | Construct a term given source, the span covered, the annotation for the term, and its children.
|
||||
--
|
||||
|
@ -34,6 +34,8 @@ styleName category = "category-" <> case category of
|
||||
Program -> "program"
|
||||
C.Error -> "error"
|
||||
BinaryOperator -> "binary-operator"
|
||||
BitwiseOperator -> "bitwise-operator"
|
||||
C.CommaOperator -> "comma-operator"
|
||||
Boolean -> "boolean"
|
||||
DictionaryLiteral -> "dictionary"
|
||||
C.Pair -> "pair"
|
||||
|
@ -40,7 +40,6 @@ categoriesForLanguage language name = case (language, name) of
|
||||
(JavaScript, "generator_function") -> Function
|
||||
(JavaScript, "math_op") -> BinaryOperator -- bitwise operator, e.g. +, -, *, /.
|
||||
(JavaScript, "bool_op") -> BinaryOperator -- boolean operator, e.g. ||, &&.
|
||||
(JavaScript, "bitwise_op") -> BinaryOperator -- bitwise operator, e.g. ^, &, etc.
|
||||
(JavaScript, "rel_op") -> BinaryOperator -- relational operator, e.g. >, <, <=, >=, ==, !=.
|
||||
(JavaScript, "comma_op") -> CommaOperator -- comma operator, e.g. expr1, expr2.
|
||||
(JavaScript, "delete_op") -> Operator -- delete operator, e.g. delete x[2].
|
||||
@ -96,6 +95,7 @@ defaultCategoryForNodeName name = case name of
|
||||
"try_statement" -> Try
|
||||
"method_definition" -> Method
|
||||
"comment" -> Comment
|
||||
"bitwise_op" -> BitwiseOperator
|
||||
_ -> Other name
|
||||
{-# INLINE defaultCategoryForNodeName #-}
|
||||
|
||||
|
2
vendor/tree-sitter-parsers
vendored
2
vendor/tree-sitter-parsers
vendored
@ -1 +1 @@
|
||||
Subproject commit 07bc6380b1e924395b5d40f33209783b96dd45fe
|
||||
Subproject commit 61b004baf78814b0335c7a1a44f6d2ba0e848e18
|
Loading…
Reference in New Issue
Block a user