summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Healy <matthew@liamhealy.xyz>2024-01-17 21:20:03 +0100
committergit <svn-admin@ruby-lang.org>2024-01-19 15:43:29 +0000
commita58e091686d9117673487b5b2ab6a793ecc81702 (patch)
treecfe2847b052295474f359520757eee94c2fded32
parent9c06297cbb3aeef0e2fdcff689885e4ae1677002 (diff)
[ruby/prism] Extract identifier lexing documentation to separate file
https://github.com/ruby/prism/commit/c9df17e3c0
-rw-r--r--lib/prism/prism.gemspec1
-rw-r--r--prism/config.yml48
2 files changed, 21 insertions, 28 deletions
diff --git a/lib/prism/prism.gemspec b/lib/prism/prism.gemspec
index a6da1b5318..7ea2f8d4e7 100644
--- a/lib/prism/prism.gemspec
+++ b/lib/prism/prism.gemspec
@@ -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",
diff --git a/prism/config.yml b/prism/config.yml
index b349481b17..26f96326f7 100644
--- a/prism/config.yml
+++ b/prism/config.yml
@@ -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`
@@ -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`
@@ -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.
@@ -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`
@@ -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`