summary refs log tree commit diff stats
path: root/lib/pure/htmlgen.nim
diff options
context:
space:
mode:
authorhlaaftana <10591326+hlaaftana@users.noreply.github.com>2020-05-03 11:22:49 +0300
committerGitHub <noreply@github.com>2020-05-03 10:22:49 +0200
commit3e060cfb0ab6b1affe26a7b09e6b4192e0d68a7f (patch)
tree40aa857657e65d3b1884297a78be40fdfa39c23c /lib/pure/htmlgen.nim
parentb56432bd8a56864679b21f4176717ad2f30e7b79 (diff)
downloadNim-3e060cfb0ab6b1affe26a7b09e6b4192e0d68a7f.tar.gz
=> supports pragmas & names (+ changed behavior) (#14200)
* => supports pragmas & names (+ changed behavior)

(x, y: int) is now parsed as (x: int, y: int) instead of
(x: auto, y: int) inside => and ->.

* fix pragma check

* fixes, use since & LHS of -> supports pragmas
Diffstat (limited to 'lib/pure/htmlgen.nim')
-rw-r--r--lib/pure/htmlgen.nim8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/pure/htmlgen.nim b/lib/pure/htmlgen.nim
index e0518f5ee..99af26c99 100644
--- a/lib/pure/htmlgen.nim
+++ b/lib/pure/htmlgen.nim
@@ -64,7 +64,7 @@ proc getIdent(e: NimNode): string {.compileTime.} =
     result = getIdent(e[0])
     for i in 1 .. e.len-1:
       result.add getIdent(e[i])
-  else: error("cannot extract identifier from node: " & toStrLit(e).strVal)
+  else: error("cannot extract identifier from node: " & toStrLit(e).strVal, e)
 
 proc delete[T](s: var seq[T], attr: T): bool =
   var idx = find(s, attr)
@@ -96,14 +96,14 @@ proc xmlCheckedTag*(argsList: NimNode, tag: string, optAttr = "", reqAttr = "",
         result.add(argsList[i][1])
         result.add(newStrLitNode("\""))
       else:
-        error("invalid attribute for '" & tag & "' element: " & name)
+        error("invalid attribute for '" & tag & "' element: " & name, argsList[i])
   # check each required attribute exists:
   if req.len > 0:
-    error(req[0] & " attribute for '" & tag & "' element expected")
+    error(req[0] & " attribute for '" & tag & "' element expected", argsList)
   if isLeaf:
     for i in 0 ..< argsList.len:
       if argsList[i].kind != nnkExprEqExpr:
-        error("element " & tag & " cannot be nested")
+        error("element " & tag & " cannot be nested", argsList[i])
     result.add(newStrLitNode(" />"))
   else:
     result.add(newStrLitNode(">"))