diff options
author | Kevin Newton <kddnewton@gmail.com> | 2023-12-08 10:10:43 -0500 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2023-12-08 18:59:52 +0000 |
commit | 98e3552cfb80d4d3a8176d9969ea4956adee93d5 (patch) | |
tree | 65908827452245cd1d3d234e0c814f22f5981919 /prism | |
parent | a94a2eea34a7d6e1bd0e97b5a3bc73adcfcbcb31 (diff) |
[ruby/prism] Add necessary encoding flags for symbols and regex
This doesn't actually fix the encodings for symbols and regex,
unfortunately. But I wanted to get this change in because it is
the last AST change we're going to make before 3.3 is released.
So, if consumers want, they can start to check these flags to
determine the encoding, even though it will be wrong. Then once we
actually set them correctly, everything should work.
https://github.com/ruby/prism/commit/9b35f7e891
Diffstat (limited to 'prism')
-rw-r--r-- | prism/config.yml | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/prism/config.yml b/prism/config.yml index 5c1cddd037..50299141bd 100644 --- a/prism/config.yml +++ b/prism/config.yml @@ -392,6 +392,12 @@ flags: comment: "s - forces the Windows-31J encoding" - name: UTF_8 comment: "u - forces the UTF-8 encoding" + - name: FORCED_UTF8_ENCODING + comment: "internal bytes forced the encoding to UTF-8" + - name: FORCED_BINARY_ENCODING + comment: "internal bytes forced the encoding to binary" + - name: FORCED_US_ASCII_ENCODING + comment: "internal bytes forced the encoding to US-ASCII" comment: Flags for regular expression and match last line nodes. - name: StringFlags values: @@ -402,6 +408,15 @@ flags: - name: FROZEN comment: "frozen by virtue of a `frozen_string_literal` comment" comment: Flags for string nodes. + - name: SymbolFlags + values: + - name: FORCED_UTF8_ENCODING + comment: "internal bytes forced the encoding to UTF-8" + - name: FORCED_BINARY_ENCODING + comment: "internal bytes forced the encoding to binary" + - name: FORCED_US_ASCII_ENCODING + comment: "internal bytes forced the encoding to US-ASCII" + comment: Flags for symbol nodes. nodes: - name: AliasGlobalVariableNode fields: @@ -2465,6 +2480,9 @@ nodes: ^^^^^^^^^^^^^^ - name: SymbolNode fields: + - name: flags + type: flags + kind: SymbolFlags - name: opening_loc type: location? - name: value_loc |