[ruby/prism] Fix rebase templates
https://github.com/ruby/prism/commit/31b8c6142f
This commit is contained in:
parent
d266b71467
commit
5141643a27
@ -526,60 +526,50 @@ module Prism
|
|||||||
erb = read_template(template)
|
erb = read_template(template)
|
||||||
extension = File.extname(filepath.gsub(".erb", ""))
|
extension = File.extname(filepath.gsub(".erb", ""))
|
||||||
|
|
||||||
heading = case extension
|
heading =
|
||||||
when ".rb"
|
case extension
|
||||||
<<~HEADING
|
when ".rb"
|
||||||
# frozen_string_literal: true
|
<<~HEADING
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
=begin
|
=begin
|
||||||
This file is generated by the templates/template.rb script and should not be
|
This file is generated by the templates/template.rb script and should not be
|
||||||
modified manually. See #{filepath}
|
modified manually. See #{filepath}
|
||||||
if you are looking to modify the template
|
if you are looking to modify the template
|
||||||
=end
|
=end
|
||||||
|
|
||||||
<<<<<<< HEAD
|
HEADING
|
||||||
HEADING
|
when ".rbs"
|
||||||
when ".rbs"
|
<<~HEADING
|
||||||
<<~HEADING
|
# This file is generated by the templates/template.rb script and should not be
|
||||||
# This file is generated by the templates/template.rb script and should not be
|
# modified manually. See #{filepath}
|
||||||
# modified manually. See #{filepath}
|
# if you are looking to modify the template
|
||||||
# if you are looking to modify the template
|
|
||||||
|
|
||||||
HEADING
|
HEADING
|
||||||
when ".rbi"
|
when ".rbi"
|
||||||
<<~HEADING
|
<<~HEADING
|
||||||
# typed: strict
|
# typed: strict
|
||||||
|
|
||||||
=begin
|
=begin
|
||||||
This file is generated by the templates/template.rb script and should not be
|
This file is generated by the templates/template.rb script and should not be
|
||||||
modified manually. See #{filepath}
|
modified manually. See #{filepath}
|
||||||
if you are looking to modify the template
|
if you are looking to modify the template
|
||||||
=end
|
=end
|
||||||
|
|
||||||
HEADING
|
HEADING
|
||||||
else
|
else
|
||||||
<<~HEADING
|
<<~HEADING
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
/* This file is generated by the templates/template.rb script and should not */
|
/* This file is generated by the templates/template.rb script and should not */
|
||||||
/* be modified manually. See */
|
/* be modified manually. See */
|
||||||
/* #{filepath + " " * (74 - filepath.size) } */
|
/* #{filepath + " " * (74 - filepath.size) } */
|
||||||
/* if you are looking to modify the */
|
/* if you are looking to modify the */
|
||||||
/* template */
|
/* template */
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
HEADING
|
HEADING
|
||||||
=======
|
end
|
||||||
{
|
|
||||||
errors: config.fetch("errors").map { |name| Error.new(name) },
|
|
||||||
warnings: config.fetch("warnings").map { |name| Warning.new(name) },
|
|
||||||
nodes: config.fetch("nodes").map { |node| NodeType.new(node) }.sort_by(&:name),
|
|
||||||
tokens: config.fetch("tokens").map { |token| Token.new(token) },
|
|
||||||
flags: config.fetch("flags").map { |flags| Flags.new(flags) }
|
|
||||||
}
|
|
||||||
>>>>>>> 35d292f929 (Expose types on diagnostics)
|
|
||||||
end
|
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
write_to ||= File.expand_path("../#{name}", __dir__)
|
write_to ||= File.expand_path("../#{name}", __dir__)
|
||||||
contents = heading + erb.result_with_hash(locals)
|
contents = heading + erb.result_with_hash(locals)
|
||||||
|
|
||||||
@ -615,6 +605,8 @@ module Prism
|
|||||||
config = YAML.load_file(File.expand_path("../config.yml", __dir__))
|
config = YAML.load_file(File.expand_path("../config.yml", __dir__))
|
||||||
|
|
||||||
{
|
{
|
||||||
|
errors: config.fetch("errors").map { |name| Error.new(name) },
|
||||||
|
warnings: config.fetch("warnings").map { |name| Warning.new(name) },
|
||||||
nodes: config.fetch("nodes").map { |node| NodeType.new(node) }.sort_by(&:name),
|
nodes: config.fetch("nodes").map { |node| NodeType.new(node) }.sort_by(&:name),
|
||||||
tokens: config.fetch("tokens").map { |token| Token.new(token) },
|
tokens: config.fetch("tokens").map { |token| Token.new(token) },
|
||||||
flags: config.fetch("flags").map { |flags| Flags.new(flags) }
|
flags: config.fetch("flags").map { |flags| Flags.new(flags) }
|
||||||
@ -626,6 +618,7 @@ module Prism
|
|||||||
TEMPLATES = [
|
TEMPLATES = [
|
||||||
"ext/prism/api_node.c",
|
"ext/prism/api_node.c",
|
||||||
"include/prism/ast.h",
|
"include/prism/ast.h",
|
||||||
|
"include/prism/diagnostic.h",
|
||||||
"javascript/src/deserialize.js",
|
"javascript/src/deserialize.js",
|
||||||
"javascript/src/nodes.js",
|
"javascript/src/nodes.js",
|
||||||
"javascript/src/visitor.js",
|
"javascript/src/visitor.js",
|
||||||
@ -640,6 +633,7 @@ module Prism
|
|||||||
"lib/prism/node.rb",
|
"lib/prism/node.rb",
|
||||||
"lib/prism/serialize.rb",
|
"lib/prism/serialize.rb",
|
||||||
"lib/prism/visitor.rb",
|
"lib/prism/visitor.rb",
|
||||||
|
"src/diagnostic.c",
|
||||||
"src/node.c",
|
"src/node.c",
|
||||||
"src/prettyprint.c",
|
"src/prettyprint.c",
|
||||||
"src/serialize.c",
|
"src/serialize.c",
|
||||||
@ -654,40 +648,6 @@ module Prism
|
|||||||
"sig/prism/_private/dot_visitor.rbs"
|
"sig/prism/_private/dot_visitor.rbs"
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
=======
|
|
||||||
TEMPLATES = [
|
|
||||||
"ext/prism/api_node.c",
|
|
||||||
"include/prism/ast.h",
|
|
||||||
"include/prism/diagnostic.h",
|
|
||||||
"javascript/src/deserialize.js",
|
|
||||||
"javascript/src/nodes.js",
|
|
||||||
"javascript/src/visitor.js",
|
|
||||||
"java/org/prism/Loader.java",
|
|
||||||
"java/org/prism/Nodes.java",
|
|
||||||
"java/org/prism/AbstractNodeVisitor.java",
|
|
||||||
"lib/prism/compiler.rb",
|
|
||||||
"lib/prism/dispatcher.rb",
|
|
||||||
"lib/prism/dot_visitor.rb",
|
|
||||||
"lib/prism/dsl.rb",
|
|
||||||
"lib/prism/mutation_compiler.rb",
|
|
||||||
"lib/prism/node.rb",
|
|
||||||
"lib/prism/serialize.rb",
|
|
||||||
"lib/prism/visitor.rb",
|
|
||||||
"src/diagnostic.c",
|
|
||||||
"src/node.c",
|
|
||||||
"src/prettyprint.c",
|
|
||||||
"src/serialize.c",
|
|
||||||
"src/token_type.c",
|
|
||||||
"rbi/prism/node.rbi",
|
|
||||||
"rbi/prism/visitor.rbi",
|
|
||||||
"sig/prism.rbs",
|
|
||||||
"sig/prism/dsl.rbs",
|
|
||||||
"sig/prism/mutation_compiler.rbs",
|
|
||||||
"sig/prism/node.rbs",
|
|
||||||
"sig/prism/visitor.rbs",
|
|
||||||
"sig/prism/_private/dot_visitor.rbs"
|
|
||||||
]
|
|
||||||
>>>>>>> 35d292f929 (Expose types on diagnostics)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if __FILE__ == $0
|
if __FILE__ == $0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user