karax DSL: allow 'foo-bar' syntax for custom HTML attributes
This commit is contained in:
parent
6ab7c9455d
commit
015590e806
1 changed files with 6 additions and 0 deletions
|
|
@ -19,6 +19,12 @@ proc getName(n: NimNode): string =
|
|||
result.add getName(n[i])
|
||||
of nnkStrLit..nnkTripleStrLit:
|
||||
result = n.strVal
|
||||
of nnkInfix:
|
||||
# allow 'foo-bar' syntax:
|
||||
if n.len == 3 and $n[0] == "-":
|
||||
result = getName(n[1]) & "-" & getName(n[2])
|
||||
else:
|
||||
expectKind(n, nnkIdent)
|
||||
else:
|
||||
#echo repr n
|
||||
expectKind(n, nnkIdent)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue