summaryrefslogtreecommitdiff
path: root/src/GF/Grammar/Parser.y
diff options
context:
space:
mode:
authorkrasimir <krasimir@chalmers.se>2009-10-02 13:25:12 +0000
committerkrasimir <krasimir@chalmers.se>2009-10-02 13:25:12 +0000
commit8e799548618318c37760a2e915eb994745574748 (patch)
treeeedbae4f6309c950e554631d94dc5b95a2a96abd /src/GF/Grammar/Parser.y
parentaf831e01a7baf6de9ac3a475368f7315c99797a7 (diff)
Implicit arguments in GF. Works only in PGF for now.
Diffstat (limited to 'src/GF/Grammar/Parser.y')
-rw-r--r--src/GF/Grammar/Parser.y12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/GF/Grammar/Parser.y b/src/GF/Grammar/Parser.y
index 4dea6b8ec..1c6b51e77 100644
--- a/src/GF/Grammar/Parser.y
+++ b/src/GF/Grammar/Parser.y
@@ -414,7 +414,8 @@ Exp3
Exp4 :: { Term }
Exp4
- : Exp4 Exp5 { App $1 $2 }
+ : Exp4 Exp5 { App $1 $2 }
+ | Exp4 '{' Exp '}' { App $1 (ImplArg $3) }
| 'case' Exp 'of' '{' ListCase '}' { let annot = case $2 of
Typed _ t -> TTyped t
_ -> TRaw
@@ -488,7 +489,6 @@ Patt2
| '#' Ident '.' Ident { PM $2 $4 }
| '_' { PW }
| Ident { PV $1 }
- | '{' Ident '}' { PC $2 [] }
| Ident '.' Ident { PP $1 $3 [] }
| Integer { PInt $1 }
| Double { PFloat $1 }
@@ -522,8 +522,12 @@ ListPattAss
ListPatt :: { [Patt] }
ListPatt
- : Patt2 { [$1] }
- | Patt2 ListPatt { $1 : $2 }
+ : PattArg { [$1] }
+ | PattArg ListPatt { $1 : $2 }
+
+PattArg :: { Patt }
+ : Patt2 { $1 }
+ | '{' Patt2 '}' { PImplArg $2 }
Arg :: { [(BindType,Ident)] }
Arg