view samples/stringops.tp @ 245:3590ecca6bc9

Fix handling of unescaped tabs in string literals in new parser
author Mike Pavone <pavone@retrodev.com>
date Mon, 06 Jan 2014 01:03:18 -0800
parents 38140b7dbe3d
children 32964a4e7a33
line wrap: on
line source
#{
	main <- {
		print: "foo: " . 42 . "\n"
		print: (string: (length: "foo" . "bar")) . "\n"
		print: (string: ("foobarbaz" find: "foo" else: { "not found" })) . "\n"
		print: (string: ("foobarbaz" find: "bar" else: { "not found" })) . "\n"
		print: (string: ("foobarbaz" find: "baz" else: { "not found" })) . "\n"
		print: (string: ("foobarbaz" find: "qux" else: { "not found" })) . "\n"

		print: ("foobarbaz" from: 3) . "\n"
		print: ("foobarbaz" from: 3 withLength: 3) . "\n"

		foreach: ("foo,bar,baz,qux" splitOn: ",") :idx val {
			print: val . "\n"
		}

		res <- "foobarbaz" partitionOn: "bar"
		print: "Before: " . (res before) . "\n"
		print: "After: " . (res after) . "\n"

		print: (string: ("12abcDEF" parseHex32)) . "\n"
		print: (string: ("FFFFFFFFFF" parseHex64)) . "\n"
	}
}