changeset 353:9390c55b9f1f

More indenting
author Adam Chlipala <adamc@hcoop.net>
date Sun, 12 Oct 2008 10:48:01 -0400
parents 2205d5cb416a
children 527529a083d9
files src/elisp/urweb-mode.el src/elisp/urweb-move.el tests/crud1.ur
diffstat 3 files changed, 40 insertions(+), 32 deletions(-) [+]
line wrap: on
line diff
--- a/src/elisp/urweb-mode.el	Sun Oct 12 10:30:08 2008 -0400
+++ b/src/elisp/urweb-mode.el	Sun Oct 12 10:48:01 2008 -0400
@@ -164,11 +164,11 @@
   `(;;(urweb-font-comments-and-strings)
     (,(concat "\\<\\(fun\\|and\\)\\s-+\\(\\sw+\\)\\s-+[^ \t\n=]")
      (1 font-lock-keyword-face)
-     (5 font-lock-function-name-face))
-    (,(concat "\\<\\(\\(data\\)?type\\|con\\)\\s-+\\(\\sw+\\)")
+     (2 font-lock-function-name-face))
+    (,(concat "\\<\\(\\(data\\)?type\\|con\\|class\\)\\s-+\\(\\sw+\\)")
      (1 font-lock-keyword-face)
      (3 font-lock-type-def-face))
-    ("\\<\\(val\\)\\s-+\\(\\sw+\\>\\s-*\\)?\\(\\sw+\\)\\s-*[=:]"
+    ("\\<\\(val\\|table\\|sequence\\)\\s-+\\(\\sw+\\>\\s-*\\)?\\(\\sw+\\)\\s-*[=:]"
      (1 font-lock-keyword-face)
      (3 font-lock-variable-name-face))
     ("\\<\\(structure\\|functor\\)\\s-+\\(\\sw+\\)"
--- a/src/elisp/urweb-move.el	Sun Oct 12 10:30:08 2008 -0400
+++ b/src/elisp/urweb-move.el	Sun Oct 12 10:48:01 2008 -0400
@@ -78,7 +78,7 @@
      (("/" "*" "%") . 7)
      (("++" "--") 8)
      (("NOT") 9)
-     (("~" "$") 10)))
+     (("~") 10)))
   "Alist of Ur/Web infix operators and their precedence.")
 
 (defconst urweb-syntax-prec
--- a/tests/crud1.ur	Sun Oct 12 10:30:08 2008 -0400
+++ b/tests/crud1.ur	Sun Oct 12 10:48:01 2008 -0400
@@ -1,36 +1,44 @@
 table t1 : {Id : int, A : int, B : string, C : float, D : bool}
 
+val a = {Nam = "A",
+         Show = txt _,
+         Widget = fn nm :: Name => <lform><textbox{nm}/></lform>,
+         WidgetPopulated = fn (nm :: Name) n =>
+                              <lform><textbox{nm} value={show _ n}/></lform>,
+         Parse = readError _,
+         Inject = _}
+
+val b = {Nam = "B",
+         Show = txt _,
+         Widget = fn nm :: Name => <lform><textbox{nm}/></lform>,
+         WidgetPopulated = fn (nm :: Name) s =>
+                              <lform><textbox{nm} value={s}/></lform>,
+         Parse = readError _,
+         Inject = _}
+
+val c = {Nam = "C",
+         Show = txt _,
+         Widget = fn nm :: Name => <lform><textbox{nm}/></lform>,
+         WidgetPopulated = fn (nm :: Name) n =>
+                              <lform><textbox{nm} value={show _ n}/></lform>,
+         Parse = readError _,
+         Inject = _}
+
+val d = {Nam = "D",
+         Show = txt _,
+         Widget = fn nm :: Name => <lform><checkbox{nm}/></lform>,
+         WidgetPopulated = fn (nm :: Name) b =>
+                              <lform><checkbox{nm} checked={b}/></lform>,
+         Parse = fn x => x,
+         Inject = _}
+
 open Crud.Make(struct
                    val tab = t1
                              
                    val title = "Crud1"
                                
-                   val cols = {
-                       A = {Nam = "A",
-                            Show = txt _,
-                            Widget = fn nm :: Name => <lform><textbox{nm}/></lform>,
-                            WidgetPopulated = fn (nm :: Name) n => <lform><textbox{nm} value={show _ n}/></lform>,
-                            Parse = readError _,
-                            Inject = _},
-                       B = {Nam = "B",
-                            Show = txt _,
-                            Widget = fn nm :: Name => <lform><textbox{nm}/></lform>,
-                            WidgetPopulated = fn (nm :: Name) s => <lform><textbox{nm} value={s}/></lform>,
-                            Parse = readError _,
-                            Inject = _
-                           },
-                       C = {Nam = "C",
-                            Show = txt _,
-                            Widget = fn nm :: Name => <lform><textbox{nm}/></lform>,
-                            WidgetPopulated = fn (nm :: Name) n => <lform><textbox{nm} value={show _ n}/></lform>,
-                            Parse = readError _,
-                            Inject = _
-                           },
-                       D = {Nam = "D",
-                            Show = txt _,
-                            Widget = fn nm :: Name => <lform><checkbox{nm}/></lform>,
-                            WidgetPopulated = fn (nm :: Name) b => <lform><checkbox{nm} checked={b}/></lform>,
-                            Parse = fn x => x,
-                            Inject = _}
-                   }
+                   val cols = {A = a,
+                               B = b,
+                               C = c,
+                               D = d}
                end)