summaryrefslogtreecommitdiff
path: root/tests/examplefiles/example.ts
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2013-01-09 15:34:02 +0100
committerGeorg Brandl <georg@python.org>2013-01-09 15:34:02 +0100
commitc6ecb6ea2d522d79ef092ed7fd3c05327d283eec (patch)
tree55273eb185075f8b1656650c59e8809f01859f52 /tests/examplefiles/example.ts
parent77f09a6cbff2c43e44c4d30330b4d696a1296823 (diff)
parent3fd41c691d82557537a4337b0cd0821080bea4dc (diff)
downloadpygments-c6ecb6ea2d522d79ef092ed7fd3c05327d283eec.tar.gz
Merged in agilbert/pygments-main/typescript (pull request #114: Add TypeScript Lexer)
Diffstat (limited to 'tests/examplefiles/example.ts')
-rw-r--r--tests/examplefiles/example.ts28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/examplefiles/example.ts b/tests/examplefiles/example.ts
new file mode 100644
index 00000000..545c6cf5
--- /dev/null
+++ b/tests/examplefiles/example.ts
@@ -0,0 +1,28 @@
+class Animal {
+ constructor(public name) { }
+ move(meters) {
+ alert(this.name + " moved " + meters + "m.");
+ }
+}
+
+class Snake extends Animal {
+ constructor(name) { super(name); }
+ move() {
+ alert("Slithering...");
+ super.move(5);
+ }
+}
+
+class Horse extends Animal {
+ constructor(name) { super(name); }
+ move() {
+ alert("Galloping...");
+ super.move(45);
+ }
+}
+
+var sam = new Snake("Sammy the Python")
+var tom: Animal = new Horse("Tommy the Palomino")
+
+sam.move()
+tom.move(34)