[PRISM] Sync latest config.yml documentation updates
This commit is contained in:
parent
41e17f5624
commit
bb3dd5b808
142
prism/config.yml
142
prism/config.yml
@ -1422,8 +1422,7 @@ nodes:
|
|||||||
- name: value
|
- name: value
|
||||||
type: node
|
type: node
|
||||||
comment: |
|
comment: |
|
||||||
The value to assign to the class variable. Can be any node that
|
The value to write to the class variable. This can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
|
||||||
represents a non-void expression.
|
|
||||||
|
|
||||||
@@foo = :bar
|
@@foo = :bar
|
||||||
^^^^
|
^^^^
|
||||||
@ -1507,13 +1506,44 @@ nodes:
|
|||||||
fields:
|
fields:
|
||||||
- name: parent
|
- name: parent
|
||||||
type: node?
|
type: node?
|
||||||
|
comment: |
|
||||||
|
The left-hand node of the path, if present. It can be `nil` or any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). It will be `nil` when the constant lookup is at the root of the module tree.
|
||||||
|
|
||||||
|
Foo::Bar
|
||||||
|
^^^
|
||||||
|
|
||||||
|
self::Test
|
||||||
|
^^^^
|
||||||
|
|
||||||
|
a.b::C
|
||||||
|
^^^
|
||||||
- name: child
|
- name: child
|
||||||
type: node
|
type: node
|
||||||
kind:
|
kind:
|
||||||
- ConstantReadNode
|
- ConstantReadNode
|
||||||
- MissingNode
|
- MissingNode
|
||||||
|
comment: |
|
||||||
|
The right-hand node of the path. Always a `ConstantReadNode` in a
|
||||||
|
valid Ruby syntax tree.
|
||||||
|
|
||||||
|
::Foo
|
||||||
|
^^^
|
||||||
|
|
||||||
|
self::Test
|
||||||
|
^^^^
|
||||||
|
|
||||||
|
a.b::C
|
||||||
|
^
|
||||||
- name: delimiter_loc
|
- name: delimiter_loc
|
||||||
type: location
|
type: location
|
||||||
|
comment: |
|
||||||
|
The location of the `::` delimiter.
|
||||||
|
|
||||||
|
::Foo
|
||||||
|
^^
|
||||||
|
|
||||||
|
One::Two
|
||||||
|
^^
|
||||||
comment: |
|
comment: |
|
||||||
Represents accessing a constant through a path of `::` operators.
|
Represents accessing a constant through a path of `::` operators.
|
||||||
|
|
||||||
@ -1570,10 +1600,28 @@ nodes:
|
|||||||
- name: target
|
- name: target
|
||||||
type: node
|
type: node
|
||||||
kind: ConstantPathNode
|
kind: ConstantPathNode
|
||||||
|
comment: |
|
||||||
|
A node representing the constant path being written to.
|
||||||
|
|
||||||
|
Foo::Bar = 1
|
||||||
|
^^^^^^^^
|
||||||
|
|
||||||
|
::Foo = :abc
|
||||||
|
^^^^^
|
||||||
- name: operator_loc
|
- name: operator_loc
|
||||||
type: location
|
type: location
|
||||||
|
comment: |
|
||||||
|
The location of the `=` operator.
|
||||||
|
|
||||||
|
::ABC = 123
|
||||||
|
^
|
||||||
- name: value
|
- name: value
|
||||||
type: node
|
type: node
|
||||||
|
comment: |
|
||||||
|
The value to write to the constant path. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
|
||||||
|
|
||||||
|
FOO::BAR = :abc
|
||||||
|
^^^^
|
||||||
comment: |
|
comment: |
|
||||||
Represents writing to a constant path.
|
Represents writing to a constant path.
|
||||||
|
|
||||||
@ -1613,12 +1661,36 @@ nodes:
|
|||||||
fields:
|
fields:
|
||||||
- name: name
|
- name: name
|
||||||
type: constant
|
type: constant
|
||||||
|
comment: |
|
||||||
|
The name of the [constant](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#constants).
|
||||||
|
|
||||||
|
Foo = :bar # name `:Foo`
|
||||||
|
|
||||||
|
XYZ = 1 # name `:XYZ`
|
||||||
- name: name_loc
|
- name: name_loc
|
||||||
type: location
|
type: location
|
||||||
|
comment: |
|
||||||
|
The location of the constant name.
|
||||||
|
|
||||||
|
FOO = 1
|
||||||
|
^^^
|
||||||
- name: value
|
- name: value
|
||||||
type: node
|
type: node
|
||||||
|
comment: |
|
||||||
|
The value to write to the constant. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
|
||||||
|
|
||||||
|
FOO = :bar
|
||||||
|
^^^^
|
||||||
|
|
||||||
|
MyClass = Class.new
|
||||||
|
^^^^^^^^^
|
||||||
- name: operator_loc
|
- name: operator_loc
|
||||||
type: location
|
type: location
|
||||||
|
comment: |
|
||||||
|
The location of the `=` operator.
|
||||||
|
|
||||||
|
FOO = :bar
|
||||||
|
^
|
||||||
comment: |
|
comment: |
|
||||||
Represents writing to a constant.
|
Represents writing to a constant.
|
||||||
|
|
||||||
@ -1908,12 +1980,36 @@ nodes:
|
|||||||
fields:
|
fields:
|
||||||
- name: name
|
- name: name
|
||||||
type: constant
|
type: constant
|
||||||
|
comment: |
|
||||||
|
The name of the global variable, which is a `$` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifier). Alternatively, it can be one of the special global variables designated by a symbol.
|
||||||
|
|
||||||
|
$foo = :bar # name `:$foo`
|
||||||
|
|
||||||
|
$_Test = 123 # name `:$_Test`
|
||||||
- name: name_loc
|
- name: name_loc
|
||||||
type: location
|
type: location
|
||||||
|
comment: |
|
||||||
|
The location of the global variable's name.
|
||||||
|
|
||||||
|
$foo = :bar
|
||||||
|
^^^^
|
||||||
- name: value
|
- name: value
|
||||||
type: node
|
type: node
|
||||||
|
comment: |
|
||||||
|
The value to write to the global variable. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
|
||||||
|
|
||||||
|
$foo = :bar
|
||||||
|
^^^^
|
||||||
|
|
||||||
|
$-xyz = 123
|
||||||
|
^^^
|
||||||
- name: operator_loc
|
- name: operator_loc
|
||||||
type: location
|
type: location
|
||||||
|
comment: |
|
||||||
|
The location of the `=` operator.
|
||||||
|
|
||||||
|
$foo = :bar
|
||||||
|
^
|
||||||
comment: |
|
comment: |
|
||||||
Represents writing to a global variable.
|
Represents writing to a global variable.
|
||||||
|
|
||||||
@ -2324,8 +2420,7 @@ nodes:
|
|||||||
- name: value
|
- name: value
|
||||||
type: node
|
type: node
|
||||||
comment: |
|
comment: |
|
||||||
The value to assign to the instance variable. Can be any node that
|
The value to write to the instance variable. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
|
||||||
represents a non-void expression.
|
|
||||||
|
|
||||||
@foo = :bar
|
@foo = :bar
|
||||||
^^^^
|
^^^^
|
||||||
@ -2616,14 +2711,50 @@ nodes:
|
|||||||
fields:
|
fields:
|
||||||
- name: name
|
- name: name
|
||||||
type: constant
|
type: constant
|
||||||
|
comment: |
|
||||||
|
The name of the local variable, which is an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifiers).
|
||||||
|
|
||||||
|
foo = :bar # name `:foo`
|
||||||
|
|
||||||
|
abc = 123 # name `:abc`
|
||||||
- name: depth
|
- name: depth
|
||||||
type: uint32
|
type: uint32
|
||||||
|
comment: |
|
||||||
|
The number of semantic scopes we have to traverse to find the declaration of this variable.
|
||||||
|
|
||||||
|
foo = 1 # depth 0
|
||||||
|
|
||||||
|
tap { foo = 1 } # depth 1
|
||||||
|
|
||||||
|
The specific rules for calculating the depth may differ from individual Ruby implementations, as they are not specified by the language. For more information, see [the Prism documentation](https://github.com/ruby/prism/blob/main/docs/local_variable_depth.md).
|
||||||
- name: name_loc
|
- name: name_loc
|
||||||
type: location
|
type: location
|
||||||
|
comment: |
|
||||||
|
The location of the variable name.
|
||||||
|
|
||||||
|
foo = :bar
|
||||||
|
^^^
|
||||||
- name: value
|
- name: value
|
||||||
type: node
|
type: node
|
||||||
|
comment: |
|
||||||
|
The value to write to the local variable. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
|
||||||
|
|
||||||
|
foo = :bar
|
||||||
|
^^^^
|
||||||
|
|
||||||
|
abc = 1234
|
||||||
|
^^^^
|
||||||
|
|
||||||
|
Note that since the name of a local variable is known before the value is parsed, it is valid for a local variable to appear within the value of its own write.
|
||||||
|
|
||||||
|
foo = foo
|
||||||
- name: operator_loc
|
- name: operator_loc
|
||||||
type: location
|
type: location
|
||||||
|
comment: |
|
||||||
|
The location of the `=` operator.
|
||||||
|
|
||||||
|
x = :y
|
||||||
|
^
|
||||||
comment: |
|
comment: |
|
||||||
Represents writing to a local variable.
|
Represents writing to a local variable.
|
||||||
|
|
||||||
@ -3411,8 +3542,7 @@ nodes:
|
|||||||
- name: predicate
|
- name: predicate
|
||||||
type: node
|
type: node
|
||||||
comment: |
|
comment: |
|
||||||
The condition to be evaluated for the unless expression. Can be any
|
The condition to be evaluated for the unless expression. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression).
|
||||||
kind of node that represents a non-void expression.
|
|
||||||
|
|
||||||
unless cond then bar end
|
unless cond then bar end
|
||||||
^^^^
|
^^^^
|
||||||
|
Loading…
x
Reference in New Issue
Block a user