[fine] Type testing with probes and reporting
I'm proud of the test harness here actually. Also fix a bug in checking!
This commit is contained in:
parent
c0f40aa512
commit
618e0028d3
10 changed files with 192 additions and 78 deletions
|
|
@ -20,3 +20,5 @@
|
|||
// | Semicolon:'";"'
|
||||
//
|
||||
1 * 2 + -3 * 4;
|
||||
|
||||
// type: 532 f64
|
||||
|
|
@ -20,3 +20,5 @@
|
|||
// | Semicolon:'";"'
|
||||
//
|
||||
true and false or false and !true;
|
||||
|
||||
// type: 549 bool
|
||||
|
|
|
|||
|
|
@ -24,3 +24,21 @@
|
|||
// | RightBrace:'"}"'
|
||||
//
|
||||
if true { "discarded"; 23 } else { 45 }
|
||||
|
||||
// Here come some type probes!
|
||||
// (type of the condition)
|
||||
// type: 667 bool
|
||||
//
|
||||
// (the discarded expression)
|
||||
// type: 674 string
|
||||
//
|
||||
// (the "then" clause)
|
||||
// type: 686 f64
|
||||
// type: 689 f64
|
||||
//
|
||||
// (the "else" clause)
|
||||
// type: 696 f64
|
||||
// type: 699 f64
|
||||
//
|
||||
// (the overall expression)
|
||||
// type: 664 f64
|
||||
|
|
@ -4,6 +4,7 @@
|
|||
// | LiteralExpression
|
||||
// | Number:'"42"'
|
||||
// | Semicolon:'";"'
|
||||
//
|
||||
// type: 138 Number
|
||||
|
||||
42;
|
||||
|
||||
// type: 129 f64
|
||||
|
|
|
|||
|
|
@ -10,3 +10,5 @@
|
|||
// | Semicolon:'";"'
|
||||
//
|
||||
"Hello " + 'world!';
|
||||
|
||||
// type: 261 string
|
||||
Loading…
Add table
Add a link
Reference in a new issue