From 64c25f1486692eb8bc81b03ec35c50b47eeaf1bf Mon Sep 17 00:00:00 2001 From: Sandy Brownlee Date: Fri, 9 Sep 2022 15:26:16 +0100 Subject: [PATCH] Added pounddemo --- .../triangle/syntacticAnalyser/TestScanner.java | 6 ++++++ programs/hi-newcomment.tri | 2 ++ programs/hi-newcomment2.tri | 8 +++++--- programs/pounddemo.tri | 15 +++++++++++++++ 4 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 programs/pounddemo.tri diff --git a/Triangle.Compiler/src/test/java/triangle/syntacticAnalyser/TestScanner.java b/Triangle.Compiler/src/test/java/triangle/syntacticAnalyser/TestScanner.java index 6da34c4..e46ed5d 100644 --- a/Triangle.Compiler/src/test/java/triangle/syntacticAnalyser/TestScanner.java +++ b/Triangle.Compiler/src/test/java/triangle/syntacticAnalyser/TestScanner.java @@ -31,6 +31,12 @@ public class TestScanner { compileExpectFailure("/hi-newcomment2.tri"); } + + @Test + public void testPoundDemo() { + compileExpectFailure("/pounddemo.tri"); + } + private void compileExpectSuccess(String filename) { diff --git a/programs/hi-newcomment.tri b/programs/hi-newcomment.tri index 74de08e..0929f38 100644 --- a/programs/hi-newcomment.tri +++ b/programs/hi-newcomment.tri @@ -1,3 +1,5 @@ +! this won't work until after some work in the practicals + # new comment begin diff --git a/programs/hi-newcomment2.tri b/programs/hi-newcomment2.tri index 1a6fb98..4e764fc 100644 --- a/programs/hi-newcomment2.tri +++ b/programs/hi-newcomment2.tri @@ -1,8 +1,10 @@ +! this won't work until after some work in the practicals + # new comment -/* - * another new comment - */ +$ +another new comment +$ begin put('H'); put('i'); put('!') diff --git a/programs/pounddemo.tri b/programs/pounddemo.tri new file mode 100644 index 0000000..67b42ae --- /dev/null +++ b/programs/pounddemo.tri @@ -0,0 +1,15 @@ +! this won't work until after some work in the practicals +let + var a : Integer; + var b : Integer + +in + begin + a := 1; + b := 2; + + putint(a) + putint(b) + putint(£a) + putint(£b) + end \ No newline at end of file