Merge pull request #51 from gradha/pr_compile_with_stable_compiler
Compile with stable compiler
This commit is contained in:
commit
2f73377f46
4 changed files with 34 additions and 6 deletions
|
|
@ -9,4 +9,4 @@ bin = "babel"
|
|||
srcDir = "src"
|
||||
|
||||
[Deps]
|
||||
Requires: "nimrod >= 0.9.5"
|
||||
Requires: "nimrod >= 0.9.4"
|
||||
|
|
|
|||
|
|
@ -10,9 +10,9 @@ package creation.
|
|||
|
||||
## Installation
|
||||
|
||||
You will need development version 0.9.5 of the [Nimrod compiler from
|
||||
GitHub](https://github.com/Araq/Nimrod). To run babel you will need to have
|
||||
installed some of the tools it depends on to check out source code. For
|
||||
You will need version 0.9.4 (or better) of the [Nimrod
|
||||
compiler](http://nimrod-lang.org/download.html). To run babel you will need to
|
||||
have installed some of the tools it depends on to check out source code. For
|
||||
instance, if a package is hosted on [Github](https://github.com) you require to
|
||||
have [git](http://www.git-scm.com) installed and added to your environment
|
||||
``PATH``. Same goes for [Mercurial](http://mercurial.selenic.com) repositories
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ import httpclient, parseopt, os, strutils, osproc, pegs, tables, parseutils,
|
|||
|
||||
from sequtils import toSeq
|
||||
|
||||
import babelpkg/packageinfo, babelpkg/version, babelpkg/tools, babelpkg/download,
|
||||
babelpkg/config
|
||||
import babelpkg/packageinfo, babelpkg/version, babelpkg/tools,
|
||||
babelpkg/download, babelpkg/config, babelpkg/compat
|
||||
|
||||
when not defined(windows):
|
||||
from posix import getpid
|
||||
|
|
|
|||
28
src/babelpkg/compat.nim
Normal file
28
src/babelpkg/compat.nim
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
# Copyright (C) Dominik Picheta. All rights reserved.
|
||||
# BSD License. Look at license.txt for more info.
|
||||
|
||||
## This module contains additional code from the development version of
|
||||
## Nimrod's standard library. These procs are required to be able to compile
|
||||
## against the last stable release 0.9.4. Once 0.9.6 is release these procs
|
||||
## will disappear.
|
||||
|
||||
import json
|
||||
|
||||
when not defined(`json.{}`):
|
||||
proc `{}`*(node: PJsonNode, key: string): PJsonNode =
|
||||
## Transverses the node and gets the given value. If any of the
|
||||
## names does not exist, returns nil
|
||||
result = node
|
||||
if isNil(node): return nil
|
||||
result = result[key]
|
||||
|
||||
when not defined(`json.{}=`):
|
||||
proc `{}=`*(node: PJsonNode, names: varargs[string], value: PJsonNode) =
|
||||
## Transverses the node and tries to set the value at the given location
|
||||
## to `value` If any of the names are missing, they are added
|
||||
var node = node
|
||||
for i in 0..(names.len-2):
|
||||
if isNil(node[names[i]]):
|
||||
node[names[i]] = newJObject()
|
||||
node = node[names[i]]
|
||||
node[names[names.len-1]] = value
|
||||
Loading…
Add table
Add a link
Reference in a new issue