Skip to content

Commit

Permalink
[ruby/prism] Extract identifier lexing documentation to separate file
Browse files Browse the repository at this point in the history
  • Loading branch information
matthew-healy authored and matzbot committed Jan 19, 2024
1 parent 9c06297 commit a58e091
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 28 deletions.
1 change: 1 addition & 0 deletions lib/prism/prism.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Gem::Specification.new do |spec|
"docs/fuzzing.md",
"docs/heredocs.md",
"docs/javascript.md",
"docs/lexing.md",
"docs/local_variable_depth.md",
"docs/mapping.md",
"docs/releasing.md",
Expand Down
48 changes: 20 additions & 28 deletions prism/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1044,11 +1044,10 @@ nodes:
- name: name
type: constant
comment: |
The name of the class variable, including the leading `@@`. Variable
names begin with an underscore, alphabetical, or non-ASCII character,
followed by arbitrarily many underscores, alphanumeric or non-ASCII
characters. The exact definitions of "alphabetical" and "alphanumeric"
are encoding-dependent.
The name of the class variable, including the leading `@@`.
For more information on permitted class variable names, see
[the Prism documentation](https://github.com/ruby/prism/blob/main/docs/lexing.md).
@@abc # name `:@@abc`
Expand Down Expand Up @@ -1224,10 +1223,10 @@ nodes:
- name: name
type: constant
comment: |
The name of the constant. Constant names begin with an upper-case
letter, followed by arbitrarily many underscores, alphanumeric or
non-ASCII characters. The exact definitions of "upper-case",
and "alphanumeric" are encoding-dependent.
The name of the constant.
For more information on permitted constant names, see
[the Prism documentation](https://github.com/ruby/prism/blob/main/docs/lexing.md).
X # name `:X`
Expand Down Expand Up @@ -1521,19 +1520,14 @@ nodes:
- name: name
type: constant
comment: |
The name of the global variable, including the leading `$`. Generally,
global variable names begin with an underscore, hyphen, alphabetical
or non-ASCII character, followed by arbitrarily many underscores,
alphanumeric or non-ASCII characters. The exact definitions of
"alphabetical" and "alphanumeric" are encoding-dependent.
The name of the global variable, including the leading `$`.
For more information on permitted global variable names, see
[the Prism documentation](https://github.com/ruby/prism/blob/main/docs/lexing.md).
$foo # name `:$foo`
$_Test # name `:$_Test`
In addition to the above, global variable names may be one of: `$~`,
`$*`, `$$`, `$?`, `$!`, `$@`, `$/`, `$\`, `$;`, `$,`, `$.`, `$=`,
`$:`, `$<`, `$>`, `$"`, or `$0`.
comment: |
Represents referencing a global variable.
Expand Down Expand Up @@ -1855,11 +1849,10 @@ nodes:
- name: name
type: constant
comment: |
The name of the instance variable, including the leading `@`. Variable
names begin with an underscore, alphabetical, or non-ASCII character,
followed by arbitrarily many underscores, alphanumeric or non-ASCII
characters. The exact definitions of "alphabetical" and "alphanumeric"
are encoding-dependent.
The name of the instance variable, including the leading `@`.
For more information on permitted instance variable names, see
[the Prism documentation](https://github.com/ruby/prism/blob/main/docs/lexing.md).
@x # name `:@x`
Expand Down Expand Up @@ -2089,11 +2082,10 @@ nodes:
- name: name
type: constant
comment: |
The name of the local variable. Local variable names begin with an
underscore or a lower-case letter, followed by arbitrarily many
underscores, alphanumeric or non-ASCII characters. The exact
definitions of "lower-case", "alphabetical" and "alphanumeric" are
encoding-dependent.
The name of the local variable.
For more information on permitted local variable names, see
[the Prism documentation](https://github.com/ruby/prism/blob/main/docs/lexing.md).
x # name `:x`
Expand Down

0 comments on commit a58e091

Please sign in to comment.