Regenerate using a fresh latest build of bat

This commit is contained in:
Spencer Williams 2020-10-06 23:48:05 -04:00 committed by David Peter
parent b30f9a1677
commit 9257c7ce20
1 changed files with 99 additions and 99 deletions

View File

@ -1,117 +1,117 @@
# An example file to test Crystal syntax highlighting in bat # An example file to test Crystal syntax highlighting in bat
my_var : Nil = nil my_var : Nil = nil
my_var_also : Int32 = 42 my_var_also : Int32 = 42
my_other_var = 4.0 my_other_var = 4.0
another_float = 4.0_f32 another_float = 4.0_f32
another_float_2 = 4e10 another_float_2 = 4e10
another_float_3 = -0.5 another_float_3 = -0.5
big_one = 1_000_000.111_111e-4 big_one = 1_000_000.111_111e-4
ternary = 1 > 2 : 3 ? 4 ternary = 1 > 2 : 3 ? 4
my_symbol = :ThisOne? my_symbol = :ThisOne?
my_other_symbol = :No_That_One! my_other_symbol = :No_That_One!
plus = :+ plus = :+
minus = :- minus = :-
my_string : String = "this string right here, with an interpolated value of #{my_var_also}" my_string : String = "this string right here, with an interpolated value of #{my_var_also}"
my_array : Array(Int32) = [1,2,3,4] my_array : Array(Int32) = [1,2,3,4]
my_tuple : Tuple(Int32, Int32, Int32, Int32) = {1,2,3,4} my_tuple : Tuple(Int32, Int32, Int32, Int32) = {1,2,3,4}
my_named_tuple : NamedTuple(one: Int32, two: Int32) = {"one": 1, "two": 2} my_named_tuple : NamedTuple(one: Int32, two: Int32) = {"one": 1, "two": 2}
my_hash : Hash(String, Int32) = {"one" => 1, "two" => 2} my_hash : Hash(String, Int32) = {"one" => 1, "two" => 2}
my_proc : Proc(Int32, Int32) = ->(x : Int32){ x * x} my_proc : Proc(Int32, Int32) = ->(x : Int32){ x * x}
my_other_proc : Proc(String) = ->{ "Wow, neat!" } my_other_proc : Proc(String) = ->{ "Wow, neat!" }
puts my_string puts my_string
puts(my_string) puts(my_string)

enum Colors enum Colors
 Red  Red
 Green  Green
 Blue  Blue
end end

class Greeter class Greeter
 @instance_field = Colors::Red  @instance_field = Colors::Red
 @@class_field = Colors::Green  @@class_field = Colors::Green

 def initialize(@name = "world")  def initialize(@name = "world")
 end  end

 def greet   def greet 
 puts "Hello, #{@name}"  puts "Hello, #{@name}"
 end  end

 def render_greeting : String  def render_greeting : String
 "Hello, #{@name}"  "Hello, #{@name}"
 end  end

 def with_greeting  def with_greeting
 yield render_greeting  yield render_greeting
 end  end

 def is_color_default?  def is_color_default?
 @instance_field == @@class_field  @instance_field == @@class_field
 end  end

 def self.greet_static(name : String) : Unit  def self.greet_static(name : String) : Unit
 puts "Hello, #{name}"  puts "Hello, #{name}"
 end  end
end end

greeter = Greeter.new("bat") greeter = Greeter.new("bat")
greeter.with_greeting do |greeting| greeter.with_greeting do |greeting|
 puts greeting  puts greeting
end end

puts <<-EOF puts <<-EOF
 this is a heredoc and it has a value in it of #{greeter.render_greeting}!  this is a heredoc and it has a value in it of #{greeter.render_greeting}!
EOF EOF

# This is a command: # This is a command:
`echo yay!` `echo yay!`
$?.success? $?.success?

my_color = Colors::Red my_color = Colors::Red

puts  puts 
 case my_color  case my_color
 when Colors::Red, .red?  when Colors::Red, .red?
 "Red"  "Red"
 when Colors::Green, .green?  when Colors::Green, .green?
 "Green"  "Green"
 when Colors::Blue, .blue?  when Colors::Blue, .blue?
 "Blue"  "Blue"
 else  else
 "I dunno, man. Chartreuse? Maroon?"  "I dunno, man. Chartreuse? Maroon?"
 end  end

class MyGenericClass(T) class MyGenericClass(T)
 def initialize(@wrapped_value : T)  def initialize(@wrapped_value : T)
 end  end

 def get  def get
 return @wrapped_value  return @wrapped_value
 end  end
end end


def do_stuff_with_range(r : Range(Int|String)) def do_stuff_with_range(r : Range(Int|String))
 return if r.empty?  return if r.empty?
 return unless !(r.empty?)  return unless !(r.empty?)
 r.each do |item|  r.each do |item|
 if /e/.match(item.to_s)  if /e/.match(item.to_s)
 puts "#{item} contains the letter e!"  puts "#{item} contains the letter e!"
 elsif item.to_s.empty?  elsif item.to_s.empty?
 break  break
 else  else
 next # this is unnecessary, but whatever  next # this is unnecessary, but whatever
 end  end
 end  end
end end


macro print_range(range) macro print_range(range)
 {% for i in range %}  {% for i in range %}
 puts {{i.id}}  puts {{i.id}}
 {% end %}  {% end %}
end end

print_range(1..3) print_range(1..3)
print_range(1...3) print_range(1...3)