1
0
mirror of https://github.com/sharkdp/bat.git synced 2025-06-19 06:46:01 +01:00

regenerated the highlighted file

This commit is contained in:
chetanjangir0
2025-04-12 19:14:15 +05:30
parent 3eef8590f4
commit 14064dd987

@ -1,71 +1,71 @@
extends Node extends Node
signal custom_signal(param) signal custom_signal(param)
const PI = 3.14159 const PI = 3.14159
var untyped_var = "Hello, World!" var untyped_var = "Hello, World!"
var typed_int: int = 42 var typed_int: int = 42
var typed_float: float = 3.14 var typed_float: float = 3.14
var typed_string: String = "GDScript Test" var typed_string: String = "GDScript Test"
var typed_array: Array = [1, 2, 3, 4] var typed_array: Array = [1, 2, 3, 4]
var typed_dict: Dictionary = {"key": "value", "number": 100} var typed_dict: Dictionary = {"key": "value", "number": 100}
onready var label = $Label onready var label = $Label
func say_hello() -> void: func say_hello() -> void:
 print("Hello from GDScript!")  print("Hello from GDScript!")
func add_numbers(a: int, b: int = 10) -> int: func add_numbers(a: int, b: int = 10) -> int:
 return a + b  return a + b
func process_value(value: int) -> String: func process_value(value: int) -> String:
 if value < 0:  if value < 0:
 return "Negative"  return "Negative"
 elif value == 0:  elif value == 0:
 return "Zero"  return "Zero"
 else:  else:
 return "Positive"  return "Positive"
func sum_array(arr: Array) -> int: func sum_array(arr: Array) -> int:
 var total: int = 0  var total: int = 0
 for num in arr:  for num in arr:
 total += num  total += num
 return total  return total
func describe_number(num: int) -> String: func describe_number(num: int) -> String:
 match num:  match num:
 0:  0:
 return "Zero"  return "Zero"
 1, 2, 3:  1, 2, 3:
 return "Small number"  return "Small number"
 _:  _:
 return "Large number"  return "Large number"
func long_description() -> String: func long_description() -> String:
 return """This is a test file for GDScript.  return """This is a test file for GDScript.
It covers variables, functions, control structures, loops, signals, inner classes, It covers variables, functions, control structures, loops, signals, inner classes,
multiline strings, arrays, and dictionaries.""" multiline strings, arrays, and dictionaries."""
class InnerExample: class InnerExample:
 var inner_value: int = 99  var inner_value: int = 99
 func show_value() -> void:  func show_value() -> void:
 print("Inner value is:", inner_value)  print("Inner value is:", inner_value)
func test_inner_class() -> void: func test_inner_class() -> void:
 var inner = InnerExample.new()  var inner = InnerExample.new()
 inner.show_value()  inner.show_value()
func trigger_signal() -> void: func trigger_signal() -> void:
 emit_signal("custom_signal", "TestParam")  emit_signal("custom_signal", "TestParam")
func _ready() -> void: func _ready() -> void:
 say_hello()  say_hello()
 var result_add = add_numbers(5)  var result_add = add_numbers(5)
 print("Add result:", result_add)  print("Add result:", result_add)
 print("Process value for -5:", process_value(-5))  print("Process value for -5:", process_value(-5))
 print("Sum of array [10, 20, 30]:", sum_array([10, 20, 30]))  print("Sum of array [10, 20, 30]:", sum_array([10, 20, 30]))
 print("Description for 2:", describe_number(2))  print("Description for 2:", describe_number(2))
 print("Long description:\n", long_description())  print("Long description:\n", long_description())
 test_inner_class()  test_inner_class()
 trigger_signal()  trigger_signal()