Skip to content

Commit 0cc7bad

Browse files
committed
[Dana] Fix calculator by removing some invalid inputs
1 parent 19dfbff commit 0cc7bad

File tree

3 files changed

+4
-11
lines changed

3 files changed

+4
-11
lines changed

dana/programs/calculator.dana

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
(* calculator.dana *)
1+
(* A line calculator *)
2+
23
def main
3-
# Helper Function
4+
# Helper Functions
45

56
def is_digit is byte: c as byte
67
if '0' <= c and c <= '9': return: true
@@ -38,7 +39,7 @@ def main
3839
# Any other characters among them get ignored.
3940
#
4041
# Output: lines with the results
41-
# or a message "Invalid" in case of failure
42+
# or a message "Invalid" in case of failure(s)
4243

4344
var buf is byte[256]
4445
var idx len start p_end a b is int

dana/programs/calculator.input

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,3 @@
55
25 + 10
66
10 * 3 dsfdfadf
77
asdf 5sdf -adfd2
8-
5-
9-
35+
10-
+7
11-
2345 _ 2342

dana/programs/calculator.result

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,3 @@
55
35
66
30
77
3
8-
Invalid
9-
Invalid
10-
Invalid
11-
Invalid

0 commit comments

Comments
 (0)