Skip to content

Commit

Permalink
[ #266 ] expanded test case
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasabel committed Mar 31, 2021
1 parent 43cf5dc commit ba485f6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
12 changes: 9 additions & 3 deletions testing/regression-tests/266_define/good01.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
integers 1, 2, 3
chars 'A'. 'a'
in 1.41421356237311 ** sqrt 2.71828182845905 ** 3.14159265358979
integers 1, 2, 3
integers 4
integers 5

chars 'A' . 'a'
chars 'B'
chars 'C'

expression 1.41421356237311 ** sqrt 2.71828182845905 ** 3.14159265358979
4 changes: 2 additions & 2 deletions testing/regression-tests/266_define/good01.out
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Parse Successful!

[Abstract Syntax]

Prg (ISnoc (ISnoc (ISnoc INil 1) 2) 3) (CSnoc (CSnoc CNil (Dot ".") 'A') (Dot ".") 'a') (EPower (EDouble 1.41421356237311) (EPower (EPower (EDouble 2.71828182845905) EHalf) (EDouble 3.14159265358979)))
[SInts (ISnoc (ISnoc (ISnoc INil 1) 2) 3),SInts (ISnoc INil 4),SInts (ISnoc INil 5),SChars (CSnoc (CSnoc CNil (Dot ".") 'A') (Dot ".") 'a'),SChars (CSnoc CNil (Dot ".") 'B'),SChars (CSnoc CNil (Dot ".") 'C'),SExp (EPower (EDouble 1.41421356237311) (EPower (EPower (EDouble 2.71828182845905) EHalf) (EDouble 3.14159265358979)))]

[Linearized tree]

integers, 1, 2, 3 chars . 'A' . 'a' in 1.41421356237311 ** (2.71828182845905 ** 1/2) ** 3.14159265358979
integers, 1, 2, 3 integers, 4 integers, 5 chars . 'A' . 'a' chars . 'B' chars . 'C' expression 1.41421356237311 ** (2.71828182845905 ** 1/2) ** 3.14159265358979
6 changes: 5 additions & 1 deletion testing/regression-tests/266_define/test.cf
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
-- #266 "define" pragma

Prg. Program ::= "integers" Ints "chars" Chars "in" Exp ;
terminator Stm "";

SInts. Stm ::= "integers" Ints;
SChars. Stm ::= "chars" Chars;
SExp. Stm ::= "expression" Exp ;

EHalf. Exp2 ::= "1/2" ;
EDouble. Exp2 ::= Double ;
Expand Down

0 comments on commit ba485f6

Please sign in to comment.