about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-09-11T13·05+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-09-11T13·05+0000
commit01d169f817649796aad94180beadbf54bb636161 (patch)
treec8f5b950bc1171b214d34539b81a10a123d584fe
parentfeb63da431eae72087fb57d723e62573ee0c4e14 (diff)
* Support `++'.
* More follow restrictions on layout.

-rw-r--r--src/libexpr/nix.sdf20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/libexpr/nix.sdf b/src/libexpr/nix.sdf
index 8546e758d4aa..8623d1d1469a 100644
--- a/src/libexpr/nix.sdf
+++ b/src/libexpr/nix.sdf
@@ -18,7 +18,11 @@ exports
   context-free start-symbols Expr
   context-free syntax
 
-    Id | Int | Str | Uri | Path -> Expr {cons("Var")}
+    Id -> Expr {cons("Var")}
+    Int -> Expr {cons("Int")}
+    Str -> Expr {cons("Str")}
+    Uri -> Expr {cons("Uri")}
+    Path -> Expr {cons("Path")}
 
     "(" Expr ")" -> Expr {bracket}
 
@@ -41,7 +45,7 @@ exports
     "inherit" ("(" Expr ")")? Id* ";" -> Bind {cons("Inherit")}
 
     "[" ExprList "]" -> Expr {cons("List")}
-    "" -> ExprList {cons("ExprNil")}
+    -> ExprList {cons("ExprNil")}
     Expr ExprList -> ExprList {cons("ExprCons")}
 
     Expr "." Id -> Expr {cons("Select")}
@@ -60,6 +64,7 @@ exports
     Expr "~" Expr -> Expr {cons("SubPath"), non-assoc}
     Expr "?" Id -> Expr {cons("OpHasAttr")}
     Expr "+" Expr -> Expr {cons("OpPlus"), left}
+    Expr "++" Expr -> Expr {cons("OpConcat"), right}
 
   context-free priorities
 
@@ -68,11 +73,13 @@ exports
   > Expr Expr -> Expr
   > Expr "~" Expr -> Expr
   > Expr "?" Id -> Expr
+  > Expr "++" Expr -> Expr
   > Expr "+" Expr -> Expr
   > "!" Expr -> Expr
   > Expr "//" Expr -> Expr
-  > Expr "==" Expr -> Expr
-  > Expr "!=" Expr -> Expr
+  > { Expr "==" Expr -> Expr
+      Expr "!=" Expr -> Expr
+    }
   > Expr "&&" Expr -> Expr
   > Expr "||" Expr -> Expr
   > Expr "->" Expr -> Expr
@@ -99,7 +106,7 @@ exports
 
     [a-zA-Z0-9\.\_\-\+]* ("/"[a-zA-Z0-9\.\_\-\+]+)+ -> Path
 
-    [a-zA-Z] [a-zA-Z0-9\+\-\.]* ":" [a-zA-Z0-9\%\/\?\:\@\&\=\+\$\,\-\_\.\!\~\*\']* -> Uri
+    [a-zA-Z] [a-zA-Z0-9\+\-\.]* ":" [a-zA-Z0-9\%\/\?\:\@\&\=\+\$\,\-\_\.\!\~\*\']+ -> Uri
 
   lexical restrictions
     Id -/- [a-zA-Z0-9\_\']
@@ -125,4 +132,5 @@ exports
   lexical restrictions
     HashComment -/- ~[\n]
   context-free restrictions
-    LAYOUT? -/- [\ \t\n]
+    LAYOUT? -/- [\ \t\n\#]
+    LAYOUT? -/- [\/].[\*]