further adaptations
This commit is contained in:
parent
cd2c6128d1
commit
c6034277fc
52 changed files with 87 additions and 87 deletions
|
|
@ -1,3 +1,3 @@
|
|||
# Simplest Nimrod program
|
||||
# Simplest Nim program
|
||||
|
||||
echo "Hello, World!"
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@ type
|
|||
|
||||
const
|
||||
ircServer = "irc.freenode.net"
|
||||
joinChans = @["#nimrod"]
|
||||
joinChans = @["#nim"]
|
||||
botNickname = "NimBot"
|
||||
|
||||
proc setSeen(d: TDb, s: TSeen) =
|
||||
|
|
@ -271,7 +271,7 @@ proc handleWebMessage(state: PState, line: string) =
|
|||
message.add("-" & $commit["removed"].len & "]: ")
|
||||
message.add(limitCommitMsg(commit["message"].str))
|
||||
|
||||
# Send message to #nimrod.
|
||||
# Send message to #nim.
|
||||
state.ircClient.privmsg(joinChans[0], message)
|
||||
elif json.hasKey("redisinfo"):
|
||||
assert json["redisinfo"].hasKey("port")
|
||||
|
|
@ -420,7 +420,7 @@ proc handleIrc(irc: PAsyncIRC, event: TIRCEvent, state: PState) =
|
|||
seenNick.msg = msg
|
||||
state.database.setSeen(seenNick)
|
||||
of MNick:
|
||||
createSeen(PSeenNick, event.nick, "#nimrod")
|
||||
createSeen(PSeenNick, event.nick, "#nim")
|
||||
seenNick.newNick = event.params[0]
|
||||
state.database.setSeen(seenNick)
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -851,7 +851,7 @@ template `=~`*(s: string, pattern: TPeg): expr =
|
|||
## This calls ``match`` with an implicit declared ``matches`` array that
|
||||
## can be used in the scope of the ``=~`` call:
|
||||
##
|
||||
## .. code-block:: nimrod
|
||||
## .. code-block:: nim
|
||||
##
|
||||
## if line =~ peg"\s* {\w+} \s* '=' \s* {\w+}":
|
||||
## # matches a key=value pair:
|
||||
|
|
@ -897,12 +897,12 @@ proc replacef*(s: string, sub: TPeg, by: string): string {.
|
|||
## Replaces `sub` in `s` by the string `by`. Captures can be accessed in `by`
|
||||
## with the notation ``$i`` and ``$#`` (see strutils.`%`). Examples:
|
||||
##
|
||||
## .. code-block:: nimrod
|
||||
## .. code-block:: nim
|
||||
## "var1=key; var2=key2".replace(peg"{\ident}'='{\ident}", "$1<-$2$2")
|
||||
##
|
||||
## Results in:
|
||||
##
|
||||
## .. code-block:: nimrod
|
||||
## .. code-block:: nim
|
||||
##
|
||||
## "var1<-keykey; val2<-key2key2"
|
||||
result = ""
|
||||
|
|
@ -979,13 +979,13 @@ iterator split*(s: string, sep: TPeg): string =
|
|||
## Substrings are separated by the PEG `sep`.
|
||||
## Examples:
|
||||
##
|
||||
## .. code-block:: nimrod
|
||||
## .. code-block:: nim
|
||||
## for word in split("00232this02939is39an22example111", peg"\d+"):
|
||||
## writeln(stdout, word)
|
||||
##
|
||||
## Results in:
|
||||
##
|
||||
## .. code-block:: nimrod
|
||||
## .. code-block:: nim
|
||||
## "this"
|
||||
## "is"
|
||||
## "an"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
discard """
|
||||
cmd: "nimrod $target --hints:on -d:embedUnidecodeTable $options $file"
|
||||
cmd: "nim $target --hints:on -d:embedUnidecodeTable $options $file"
|
||||
output: "Ausserst"
|
||||
"""
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
discard """
|
||||
file: "txmlgen.nim"
|
||||
output: "<h1><a href=\"http://force7.de/nimrod\">Nimrod</a></h1>"
|
||||
output: "<h1><a href=\"http://force7.de/nim\">Nim</a></h1>"
|
||||
"""
|
||||
import htmlgen
|
||||
|
||||
var nim = "Nimrod"
|
||||
echo h1(a(href="http://force7.de/nimrod", nim))
|
||||
var nim = "Nim"
|
||||
echo h1(a(href="http://force7.de/nim", nim))
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ discard """
|
|||
|
||||
import xmltree, strtabs
|
||||
|
||||
var x = <>a(href="nimrod.de", newText("www.nimrod-test.de"))
|
||||
var x = <>a(href="nim.de", newText("www.nim-test.de"))
|
||||
|
||||
echo($x == "<a href=\"nimrod.de\">www.nimrod-test.de</a>")
|
||||
echo($x == "<a href=\"nim.de\">www.nim-test.de</a>")
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue