@@ -7,6 +7,8 @@ CodeQL has a large selection of classes for representing the abstract syntax tre
7
7
8
8
.. include :: ../reusables/abstract-syntax-tree.rst
9
9
10
+ The descriptions below use the following conventions and placeholders.
11
+
10
12
* An ``IDENTIFIER `` denotes an arbitrary identifier.
11
13
* A ``CNAME `` denotes a class or module name.
12
14
* An ``FNAME `` denotes a method name.
@@ -16,7 +18,7 @@ CodeQL has a large selection of classes for representing the abstract syntax tre
16
18
Statement classes
17
19
~~~~~~~~~~~~~~~~~
18
20
19
- This table lists subclasses of Stmt _ representing Ruby statements.
21
+ This table lists subclasses of Stmt _ that represent Ruby statements.
20
22
21
23
+---------------------------------+--------------+----------------+---------+
22
24
| Statement syntax | CodeQL class | Superclasses | Remarks |
60
62
+----------------------------+---------------------+----------------+-------------------------------+
61
63
| ``yield `` «Expr _ ``, ``»* | YieldCall _ | Call _ | |
62
64
+----------------------------+---------------------+----------------+-------------------------------+
63
- | ``&IDENTIFIER `` | BlockArgument _ | Expr _ | Used as an argument to a call |
65
+ | ``&``IDENTIFIER | BlockArgument _ | Expr _ | Used as an argument to a call |
64
66
+----------------------------+---------------------+----------------+-------------------------------+
65
67
| ``... `` | ForwardedArguments _ | Expr _ | Used as an argument to a call |
66
68
+----------------------------+---------------------+----------------+-------------------------------+
@@ -116,25 +118,25 @@ Unary operations
116
118
117
119
All classes in this subsection are subclasses of UnaryOperation _.
118
120
119
- +--------------------+----------------+- ---------------------------+-------------------+
121
+ +--------------------+-----------------+ ---------------------------+-------------------+
120
122
| Expression syntax | CodeQL class | Superclasses | Remarks |
121
- +====================+================+= ===========================+===================+
123
+ +====================+=================+ ===========================+===================+
122
124
| ``~ `` Expr _ | ComplementExpr _ | UnaryBitwiseOperation _ | |
123
- +--------------------+----------------+- ---------------------------+-------------------+
125
+ +--------------------+-----------------+ ---------------------------+-------------------+
124
126
| ``defined? `` Expr _ | DefinedExpr _ | UnaryOperation _ | |
125
- +--------------------+----------------+- ---------------------------+-------------------+
127
+ +--------------------+-----------------+ ---------------------------+-------------------+
126
128
| ``** `` Expr _ | HashSplatExpr _ | UnaryOperation _ | |
127
- +--------------------+----------------+- ---------------------------+-------------------+
129
+ +--------------------+-----------------+ ---------------------------+-------------------+
128
130
| ``! `` Expr _ | NotExpr _ | UnaryOperation _ | |
129
- +--------------------+----------------+- ---------------------------+-------------------+
131
+ +--------------------+-----------------+ ---------------------------+-------------------+
130
132
| ``not `` Expr _ | NotExpr _ | UnaryOperation _ | |
131
- +--------------------+----------------+- ---------------------------+-------------------+
133
+ +--------------------+-----------------+ ---------------------------+-------------------+
132
134
| ``* `` Expr _ | SplatExpr _ | UnaryOperation _ | |
133
- +--------------------+----------------+- ---------------------------+-------------------+
135
+ +--------------------+-----------------+ ---------------------------+-------------------+
134
136
| ``- `` Expr _ | UnaryMinusExpr _ | UnaryArithmeticOperation _ | |
135
- +--------------------+----------------+- ---------------------------+-------------------+
137
+ +--------------------+-----------------+ ---------------------------+-------------------+
136
138
| ``+ `` Expr _ | UnaryPlusExpr _ | UnaryArithmeticOperation _ | |
137
- +--------------------+----------------+- ---------------------------+-------------------+
139
+ +--------------------+-----------------+ ---------------------------+-------------------+
138
140
139
141
Binary operations
140
142
~~~~~~~~~~~~~~~~~
@@ -336,7 +338,7 @@ All classes in this subsection are subclasses of Parameter_.
336
338
Pattern classes
337
339
~~~~~~~~~~~~~~~
338
340
339
- All classes in this subsection are subclasses of CasePattern _. These expressions typically occur in the context of a ``case `` using pattern matching syntax.
341
+ All classes in this subsection are subclasses of CasePattern _. These expressions typically occur when a ``case `` uses pattern matching syntax.
340
342
341
343
+--------------------------------------------------------------------------------+-----------------------+--------------+-------------------+
342
344
| Expression syntax | CodeQL class | Superclasses | Remarks |
@@ -392,7 +394,7 @@ All classes in this subsection are subclasses of VariableAccess_.
392
394
393
395
+----------------------------+------------------------------+-----------------------------------------------+------------------+
394
396
| Example expression syntax | CodeQL class | Superclasses | Remarks |
395
- +===========================+==============================+= ===============================================+==================+
397
+ +============================ +==============================+===============================================+==================+
396
398
| ``@@foo `` | ClassVariableReadAccess _ | VariableReadAccess _, ClassVariableAccess _ | |
397
399
+----------------------------+------------------------------+-----------------------------------------------+------------------+
398
400
| ``@@foo = 'str' `` | ClassVariableWriteAccess _ | VariableWriteAccess _, ClassVariableAccess _ | |
0 commit comments