Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d218572

Browse files
Ruby: Apply review suggestions for AST reference guide
Co-authored-by: Felicity Chapman <[email protected]>
1 parent 727b5ae commit d218572

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

docs/codeql/codeql-language-guides/abstract-syntax-tree-classes-for-working-with-ruby-programs.rst

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ CodeQL has a large selection of classes for representing the abstract syntax tre
77

88
.. include:: ../reusables/abstract-syntax-tree.rst
99

10+
The descriptions below use the following conventions and placeholders.
11+
1012
* An ``IDENTIFIER`` denotes an arbitrary identifier.
1113
* A ``CNAME`` denotes a class or module name.
1214
* An ``FNAME`` denotes a method name.
@@ -16,7 +18,7 @@ CodeQL has a large selection of classes for representing the abstract syntax tre
1618
Statement classes
1719
~~~~~~~~~~~~~~~~~
1820

19-
This table lists subclasses of Stmt_ representing Ruby statements.
21+
This table lists subclasses of Stmt_ that represent Ruby statements.
2022

2123
+---------------------------------+--------------+----------------+---------+
2224
| Statement syntax | CodeQL class | Superclasses | Remarks |
@@ -60,7 +62,7 @@ Calls
6062
+----------------------------+---------------------+----------------+-------------------------------+
6163
| ``yield`` «Expr_ ``,``»* | YieldCall_ | Call_ | |
6264
+----------------------------+---------------------+----------------+-------------------------------+
63-
| ``&IDENTIFIER`` | BlockArgument_ | Expr_ | Used as an argument to a call |
65+
| ``&``IDENTIFIER | BlockArgument_ | Expr_ | Used as an argument to a call |
6466
+----------------------------+---------------------+----------------+-------------------------------+
6567
| ``...`` | ForwardedArguments_ | Expr_ | Used as an argument to a call |
6668
+----------------------------+---------------------+----------------+-------------------------------+
@@ -116,25 +118,25 @@ Unary operations
116118

117119
All classes in this subsection are subclasses of UnaryOperation_.
118120

119-
+--------------------+----------------+----------------------------+-------------------+
121+
+--------------------+-----------------+---------------------------+-------------------+
120122
| Expression syntax | CodeQL class | Superclasses | Remarks |
121-
+====================+================+============================+===================+
123+
+====================+=================+===========================+===================+
122124
| ``~`` Expr_ | ComplementExpr_ | UnaryBitwiseOperation_ | |
123-
+--------------------+----------------+----------------------------+-------------------+
125+
+--------------------+-----------------+---------------------------+-------------------+
124126
| ``defined?`` Expr_ | DefinedExpr_ | UnaryOperation_ | |
125-
+--------------------+----------------+----------------------------+-------------------+
127+
+--------------------+-----------------+---------------------------+-------------------+
126128
| ``**`` Expr_ | HashSplatExpr_ | UnaryOperation_ | |
127-
+--------------------+----------------+----------------------------+-------------------+
129+
+--------------------+-----------------+---------------------------+-------------------+
128130
| ``!`` Expr_ | NotExpr_ | UnaryOperation_ | |
129-
+--------------------+----------------+----------------------------+-------------------+
131+
+--------------------+-----------------+---------------------------+-------------------+
130132
| ``not`` Expr_ | NotExpr_ | UnaryOperation_ | |
131-
+--------------------+----------------+----------------------------+-------------------+
133+
+--------------------+-----------------+---------------------------+-------------------+
132134
| ``*`` Expr_ | SplatExpr_ | UnaryOperation_ | |
133-
+--------------------+----------------+----------------------------+-------------------+
135+
+--------------------+-----------------+---------------------------+-------------------+
134136
| ``-`` Expr_ | UnaryMinusExpr_ | UnaryArithmeticOperation_ | |
135-
+--------------------+----------------+----------------------------+-------------------+
137+
+--------------------+-----------------+---------------------------+-------------------+
136138
| ``+`` Expr_ | UnaryPlusExpr_ | UnaryArithmeticOperation_ | |
137-
+--------------------+----------------+----------------------------+-------------------+
139+
+--------------------+-----------------+---------------------------+-------------------+
138140

139141
Binary operations
140142
~~~~~~~~~~~~~~~~~
@@ -336,7 +338,7 @@ All classes in this subsection are subclasses of Parameter_.
336338
Pattern classes
337339
~~~~~~~~~~~~~~~
338340

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.
340342

341343
+--------------------------------------------------------------------------------+-----------------------+--------------+-------------------+
342344
| Expression syntax | CodeQL class | Superclasses | Remarks |
@@ -392,7 +394,7 @@ All classes in this subsection are subclasses of VariableAccess_.
392394

393395
+----------------------------+------------------------------+-----------------------------------------------+------------------+
394396
| Example expression syntax | CodeQL class | Superclasses | Remarks |
395-
+===========================+==============================+================================================+==================+
397+
+============================+==============================+===============================================+==================+
396398
| ``@@foo`` | ClassVariableReadAccess_ | VariableReadAccess_, ClassVariableAccess_ | |
397399
+----------------------------+------------------------------+-----------------------------------------------+------------------+
398400
| ``@@foo = 'str'`` | ClassVariableWriteAccess_ | VariableWriteAccess_, ClassVariableAccess_ | |

0 commit comments

Comments
 (0)