1
0
forked from GitHub/gf-core

Add unit test for literals (fails)

This commit is contained in:
John J. Camilleri
2021-03-22 08:37:59 +01:00
parent f900ea3885
commit 2d066853f1
6 changed files with 34 additions and 2 deletions

View File

@@ -104,11 +104,17 @@ Max memory: 328.20 MB
- size: 3.01 MB Phrasebook.lpgf
Max memory: 1.33 GB
**Baseline LPGF String**
**Baseline LPGF String instead of Text**
- compile: 12.124689s
- size: 3.01 MB Phrasebook.lpgf
Max memory: 1.34 GB
**Baseline LPGF with impossible pruning**
- compile: 7.406503s
- size: 3.01 MB Phrasebook.lpgf
Max memory: 1.13 GB
**B -extractStrings**
- compile: 13.822735s
- size: 5.78 MB Phrasebook.lpgf

View File

@@ -21,7 +21,7 @@ done < $TREES
echo "Writing $TREEBANK"
: > $TREEBANK
gf --crun $ABSNAME.pgf < "$SCRIPT" > /dev/null
gf --crun "$ABSNAME.pgf" < "$SCRIPT" > /dev/null
echo "Removing $SCRIPT"
rm "$SCRIPT"

View File

@@ -0,0 +1,7 @@
abstract Literals = {
cat S ;
fun
mkString : String -> S ;
mkInt : Int -> S ;
mkFloat : Float -> S ;
}

View File

@@ -0,0 +1,9 @@
Literals: mkString "hello"
LiteralsCnc: hello
Literals: mkInt 123
LiteralsCnc: 123
Literals: mkFloat 30.809000
LiteralsCnc: 30.809000

View File

@@ -0,0 +1,3 @@
mkString "hello"
mkInt 123
mkFloat 30.809

View File

@@ -0,0 +1,7 @@
concrete LiteralsCnc of Literals = open Prelude in {
lincat S = SS ;
lin
mkString s = s ;
mkInt s = s ;
mkFloat s = s ;
}