Pragma: UseUtils

BeginProgram: OutputFormatting2

BeginMain:
	ScalarDecl: const <int> a = 326
	ScalarDecl: const <int> b = -1
	ScalarDecl: const <int> c = 2015
	ScalarDecl: const <long> i1 = 65000
	ScalarDecl: const <long> i2 = -2
	ScalarDecl: const <long> i3 = 3261963
	ScalarDecl: const <double> f1 = 3.1415926
	ScalarDecl: const <double> f2 = 2.99792458e9
	ScalarDecl: const <double> f3 = 1.234e-4
	ScalarDecl: const <codepoint_t> c1 = ord('A')
	ScalarDecl: const <codepoint_t> c2 = ord('B')
	ScalarDecl: const <codepoint_t> c3 = ord('C')
	ScalarDecl: const <string> s1 = "Apples"
	ScalarDecl: const <string> s2 = "and"
	ScalarDecl: const <string> s3 = "Bananas"
	ScalarDecl: const <bool> b1 = true
	ScalarDecl: const <bool> b2 = false

	ScalarDecl: <string> s

	Assign: s = sprintf("Decimals: %d %d %d", a, b, c)
	PrintLine: s
BeginEval: language =~ m/cpp|pl/
	Assign: s = sprintf("Unsigned Decimals: %u %u %u", a, b, c)
	PrintLine: s
EndEval
BeginEval: language !~ m/js/
	Assign: s = sprintf("Hexadecimals: %#x %#x %#x", a, b, c)
	PrintLine: s
EndEval
BeginEval: language =~ m/cpp/
	Assign: s = sprintf("Long Decimals: %ld %ld %ld", i1, i2, i3)
	PrintLine: s
	Assign: s = sprintf("Long Hexadecimals: %016lx %016lx %016lx", i1, i2, i3)
	PrintLine: s
EndEval
BeginEval: language !~ m/cpp/
	Assign: s = sprintf("Long Decimals: %d %d %d", i1, i2, i3)
	PrintLine: s
EndEval
BeginEval: language !~ m/cpp|js/
	Assign: s = sprintf("Long Hexadecimals: %016x %016x %016x", i1, i2, i3)
	PrintLine: s
EndEval

	Assign: s = sprintf("Fixed FP: %f %f %f", f1, f2, f3)
	PrintLine: s
BeginEval: language !~ m/js/
	Assign: s = sprintf("Exponential FP: %e %e %e", f1, f2, f3)
	PrintLine: s
	Assign: s = sprintf("General FP: %g %g %g", f1, f2, f3)
	PrintLine: s
	Assign: s = sprintf("General FP with precision: %.2g %.2g %.2g", f1, f2, f3)
	PrintLine: s
EndEval

BeginEval: language =~ m/cpp/
	Assign: s = sprintf("Boolean: %d %d", b1, b2)
	PrintLine: s
EndEval
BeginEval: language =~ m/js/
	Assign: s = sprintf("Boolean: %t %t", b1, b2)
	PrintLine: s
EndEval
BeginEval: language =~ m/java|pl/
	Assign: s = sprintf("Boolean: %b %b", b1, b2)
	PrintLine: s
EndEval
BeginEval: language =~ m/js|py/
	Assign: s = sprintf("Boolean: %s %s", b1, b2)
	PrintLine: s
EndEval
BeginEval: language =~ m/swift/
	Assign: s = sprintf("Boolean: %@ %@", String(b1), String(b2))
	PrintLine: s
EndEval
BeginEval: language =~ m/cpp|java|pl|py/
	Assign: s = sprintf("Character: %c %c %c", c1, c2, c3)
	PrintLine: s
ElseIfEval: language =~ m/js/
	Assign: s = sprintf("Character: %s %s %s", chr(c1), chr(c2), chr(c3))
	PrintLine: s
ElseEval
	Assign: s = sprintf("Character: %@ %@ %@", chr(c1), chr(c2), chr(c3))
	PrintLine: s
EndEval
BeginEval: language =~ m/cpp/
	Assign: s = sprintf("String: %s %s %s", @@@s1.c_str()@@@, @@@s2.c_str()@@@, @@@s3.c_str()@@@)
	PrintLine: s
EndEval
BeginEval: language =~ m/swift/
	Assign: s = sprintf("String: %@ %@ %@", s1, s2, s3)
	PrintLine: s
EndEval
BeginEval: language !~ m/cpp|swift/
	Assign: s = sprintf("String: %s %s %s", s1, s2, s3)
	PrintLine: s
EndEval
EndMain
EndProgram
