Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions lib/syntax_tree/node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7456,6 +7456,7 @@ def deconstruct_keys(_keys)
{
beginning: beginning,
ending: ending,
options: options,
parts: parts,
location: location,
comments: comments
Expand Down Expand Up @@ -7490,18 +7491,22 @@ def format(q)
end

q.text("}")
q.text(ending[1..])
q.text(options)
end
else
q.group do
q.text("/")
q.format_each(parts)
q.text("/")
q.text(ending[1..])
q.text(options)
end
end
end

def options
ending[1..]
end

private

def include?(pattern)
Expand Down
1 change: 1 addition & 0 deletions lib/syntax_tree/visitor/field_visitor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,7 @@ def visit_regexp_end(node)
def visit_regexp_literal(node)
node(node, "regexp_literal") do
list("parts", node.parts)
field("options", node.options)
comments(node)
end
end
Expand Down