diff options
author | Araq <rumpf_a@web.de> | 2011-08-02 12:55:56 -0700 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2011-08-02 12:55:56 -0700 |
commit | 7670466d433ea9b0e2f34c3a6720e7172089c71c (patch) | |
tree | ce13fc258b6e371f4516e6d23a0fd0da7699fbaa | |
parent | f0145ba7c5142b2ea7da8c77522600a251145875 (diff) | |
parent | 74947d01850c1b96c017e14689e9ca77359ff052 (diff) | |
download | Nim-7670466d433ea9b0e2f34c3a6720e7172089c71c.tar.gz |
Merge pull request #46 from keitahaga/examples
Fixed examples/keyval2.nim
-rwxr-xr-x | examples/keyval.nim | 2 | ||||
-rwxr-xr-x | examples/keyval2.nim | 4 | ||||
-rwxr-xr-x | examples/myfile.txt | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/examples/keyval.nim b/examples/keyval.nim index 19a430a1e..ae8cb8f08 100755 --- a/examples/keyval.nim +++ b/examples/keyval.nim @@ -3,7 +3,7 @@ import re for x in lines("myfile.txt"): if x =~ re"(\w+)=(.*)": - echo "Key: ", matches[0], + echo "Key: ", matches[0], " Value: ", matches[1] diff --git a/examples/keyval2.nim b/examples/keyval2.nim index 5e7d0ea4a..2a5643276 100755 --- a/examples/keyval2.nim +++ b/examples/keyval2.nim @@ -3,5 +3,5 @@ import pegs for x in lines("myfile.txt"): if x =~ peg"{\ident} \s* '=' \s* {.*}": - echo "Key: ", matches[1], - " Value: ", matches[2] + echo "Key: ", matches[0], + " Value: ", matches[1] diff --git a/examples/myfile.txt b/examples/myfile.txt index 1df0d56f8..fb7cda984 100755 --- a/examples/myfile.txt +++ b/examples/myfile.txt @@ -6,6 +6,6 @@ asdflksadlfasf adsfljksadfl -key=/usr/bin/value +key=/usr/bin/value key2=/ha/ha |