summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Newton <kddnewton@gmail.com>2024-01-11 14:19:41 -0500
committergit <svn-admin@ruby-lang.org>2024-01-11 19:27:14 +0000
commit72be7860170d2ccec7713a2b0ef43da133799d71 (patch)
tree0745ec8f6997cde89544281b8db4065a2863658a
parent242dc537f93a0e11d91e729823cf8df2caec6abd (diff)
[ruby/prism] Allow fsl comment to set to false
https://github.com/ruby/prism/commit/b4db7bb703
-rw-r--r--prism/prism.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/prism/prism.c b/prism/prism.c
index c169bcadd8..96725b1ee0 100644
--- a/prism/prism.c
+++ b/prism/prism.c
@@ -6361,8 +6361,10 @@ parser_lex_magic_comment_encoding(pm_parser_t *parser) {
*/
static void
parser_lex_magic_comment_frozen_string_literal_value(pm_parser_t *parser, const uint8_t *start, const uint8_t *end) {
- if (start + 4 <= end && pm_strncasecmp(start, (const uint8_t *) "true", 4) == 0) {
+ if ((start + 4 <= end) && pm_strncasecmp(start, (const uint8_t *) "true", 4) == 0) {
parser->frozen_string_literal = true;
+ } else if ((start + 5 <= end) && pm_strncasecmp(start, (const uint8_t *) "false", 5) == 0) {
+ parser->frozen_string_literal = false;
}
}