1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 22:31:36 +03:00
semantic/src/Category.hs

59 lines
1.4 KiB
Haskell
Raw Normal View History

module Category where
2015-11-18 22:23:35 +03:00
import Prologue
2015-11-18 22:23:35 +03:00
2016-02-05 00:35:42 +03:00
-- | A standardized category of AST node. Used to determine the semantics for
-- | semantic diffing and define comparability of nodes.
data Category
-- | The top-level branch node.
= Program
2016-06-04 01:37:40 +03:00
-- | A node indicating syntax errors.
| Error
2016-06-16 17:54:05 +03:00
-- | A boolean expression.
| Boolean
2016-02-06 00:59:38 +03:00
-- | An operator with 2 operands.
| BinaryOperator
2016-02-05 00:35:42 +03:00
-- | A literal key-value data structure.
2016-02-06 00:59:38 +03:00
| DictionaryLiteral
2016-02-14 05:01:52 +03:00
-- | A pair, e.g. of a key & value
| Pair
2016-02-06 00:54:08 +03:00
-- | A call to a function.
| FunctionCall
2016-06-10 22:19:29 +03:00
-- | A function declaration.
2016-06-10 20:11:32 +03:00
| Function
2016-06-10 22:19:29 +03:00
-- | An identifier.
| Identifier
2016-06-12 21:29:48 +03:00
-- | A function's parameters.
| Params
2016-06-12 21:29:48 +03:00
-- | A function's expression statements.
| ExpressionStatements
-- | A method call on an object.
| MethodCall
2016-06-14 19:53:35 +03:00
-- | A method's arguments.
| Args
-- | A string literal.
| StringLiteral
-- | An integer literal.
| IntegerLiteral
-- | A regex literal.
| Regex
-- | A symbol literal.
| SymbolLiteral
2016-06-15 18:38:16 +03:00
-- | A template string literal.
| TemplateString
2016-03-03 07:01:46 +03:00
-- | An array literal.
| ArrayLiteral
2016-06-14 01:31:45 +03:00
-- | An assignment expression.
2016-06-14 00:31:32 +03:00
| Assignment
2016-06-14 01:31:45 +03:00
-- | A member access expression.
| MemberAccess
-- | A variable assignment within a variable declaration.
| VarAssignment
-- | A variable declaration.
| VarDecl
2016-06-16 01:48:27 +03:00
| Switch
| Case
2016-02-05 00:35:42 +03:00
-- | A non-standard category, which can be used for comparability.
| Other Text
2016-02-05 00:47:33 +03:00
deriving (Eq, Show, Ord)