summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorGravatar Checkmate50 <dgeisler50@gmail.com>2016-05-31 12:08:07 -0600
committerGravatar Checkmate50 <dgeisler50@gmail.com>2016-05-31 12:08:07 -0600
commit6f7fc01346c0ebe9072e61ace2cfede4fcedea09 (patch)
tree6d55790d0180d5e8cf1a79ea03ad6ce3b2019f17 /Source
parent51b7e8146f413b83a412572fcc9e3a1a8b302b79 (diff)
Initial round of testing works with new syntax. Fixed an error where floating points could not be given as a function argument
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/Parser.cs27
-rw-r--r--Source/Core/Scanner.cs2
2 files changed, 14 insertions, 15 deletions
diff --git a/Source/Core/Parser.cs b/Source/Core/Parser.cs
index 77100d1c..8161544f 100644
--- a/Source/Core/Parser.cs
+++ b/Source/Core/Parser.cs
@@ -668,9 +668,8 @@ private class BvBounds : Expr {
ty = new BasicType(t, SimpleType.Real);
} else if (la.kind == 98) {
Get();
- if (la.kind == 3) {
- Get();
- switch (Int32.Parse(t.val)) {
+ if (t.val.Length > 5) {
+ switch (Int32.Parse(t.val.Substring(5))) {
case 16:
ty = new FloatType(t, 5, 11);
break;
@@ -690,10 +689,10 @@ private class BvBounds : Expr {
}
else {
Expect(19); //<
- Expect(3);
+ Expect(3); //int
int exp = Int32.Parse(t.val);
Expect(12); //,
- Expect(3);
+ Expect(3); //int
int man = Int32.Parse(t.val);
ty = new FloatType(t, exp, man);
Expect(20); //>
@@ -1830,14 +1829,14 @@ out List<Variable>/*!*/ ins, out List<Variable>/*!*/ outs, out QKeyValue kv) {
break;
}
case 98: {
- Get();
- x = t;
- Expect(19);
- Expression(out e);
- Expect(20);
- e = new NAryExpr(x, new ArithmeticCoercion(x, ArithmeticCoercion.CoercionType.ToFloat), new List<Expr> { e });
- break;
- }
+ Get();
+ x = t;
+ Expect(19);
+ Expression(out e);
+ Expect(20);
+ e = new NAryExpr(x, new ArithmeticCoercion(x, ArithmeticCoercion.CoercionType.ToFloat), new List<Expr> { e });
+ break;
+ }
case 9: {
Get();
if (StartOf(9)) {
@@ -2188,7 +2187,7 @@ out QKeyValue kv, out Trigger trig, out Expr/*!*/ body) {
static readonly bool[,]/*!*/ set = { //grid is 17 x 100
{T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x},
{x,x,x,x, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,T,x,x, x,T,x,x, x,T,T,x, T,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x},
- {x,T,x,x, x,x,x,x, x,T,x,x, x,x,T,T, T,T,x,T, x,x,x,x, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x},
+ {x,T,x,x, x,x,x,x, x,T,x,x, x,x,T,T, T,T,x,T, x,x,x,x, x,x,x,T, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x},
{x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,T, T,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x},
{x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,T, x,x,x,x, x,x,T,T, T,T,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x},
{x,x,x,x, x,x,x,x, x,T,x,x, x,x,T,T, T,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,x,x, x,x,T,x},
diff --git a/Source/Core/Scanner.cs b/Source/Core/Scanner.cs
index bc294aba..ca7db1e1 100644
--- a/Source/Core/Scanner.cs
+++ b/Source/Core/Scanner.cs
@@ -509,7 +509,7 @@ public class Scanner {
case "real": t.kind = 15; break;
case "bool": t.kind = 16; break;
case "fp": t.kind = 97; break;
- case "float": t.kind = 98; break;
+ case "float": case "float16": case "float32": case "float64": case "float128": t.kind = 98; break;
case "const": t.kind = 21; break;
case "unique": t.kind = 22; break;
case "extends": t.kind = 23; break;