summary refs log tree commit diff stats
path: root/lib
Commit message (Expand)AuthorAgeFilesLines
* added missing file for --gc:stackAndreas Rumpf2016-03-311-0/+44
* Merge pull request #4000 from vegansk/fix_rlocks_warnsAndreas Rumpf2016-03-314-20/+20
|\
| * Move ``compiles`` backAnatoly Galiulin2016-03-311-10/+10
| * Use ``when insideRLocksModule`` instead of ``when compiles``Anatoly Galiulin2016-03-313-2/+4
| * Fix ``XDeclaredButNotUsed`` warning when locks or rlocks module is usedAnatoly Galiulin2016-03-314-30/+28
* | Merge pull request #4013 from vegansk/parse_uintsAndreas Rumpf2016-03-312-0/+59
|\ \ | |/ |/|
| * Remove dead codeAnatoly Galiulin2016-03-311-11/+1
| * Add parseUInt and parseBiggestUInt functions to stdlib (parseutils, strutils)Anatoly Galiulin2016-03-302-0/+69
* | Merge pull request #4018 from cheatfate/dyncalls_changeAndreas Rumpf2016-03-311-2/+23
|\ \
| * | Replace csprintf() in windows version of nimGetProcAddr to pure nim's impleme...cheatfate2016-03-311-2/+23
| |/
* / Make windows locks do not use dyncallcheatfate2016-03-311-12/+14
|/
* Merge pull request #4009 from PMunch/json-objecthashing-fixAndreas Rumpf2016-03-291-1/+1
|\
| * Changed the JSON object hashing procedure to use a symmetric operator to disr...Peter Munch-Ellingsen2016-03-291-1/+1
* | Windows: fixes a regression; codegen might not know about & at this pointAraq2016-03-292-2/+3
* | resolved merge conflictsAraq2016-03-2927-207/+974
|\ \
| * | Makes dyncall errors report to stderr. Fixes #3987Alex Berghage2016-03-291-7/+7
| * | munmap for LLVMAndreas Rumpf2016-03-281-2/+2
| * | added new memory management ideaAndreas Rumpf2016-03-281-0/+382
| * | added missing fileAndreas Rumpf2016-03-281-0/+95
| * | beginnings of --gc:stackAndreas Rumpf2016-03-283-149/+175
| * | GCs support ForeignCellsAndreas Rumpf2016-03-284-0/+47
| * | Define ports as uint16s to fix #3484Josep Sanjuas2016-03-275-26/+74
| * | Merge pull request #3988 from lihf8515/develAndreas Rumpf2016-03-231-80/+122
| |\ \
| | * | Repair using the db_odbc module to query the Oracle database, the program com...lihf85152016-03-211-80/+122
| * | | Merge pull request #3982 from cheatfate/kqueue.nimDominik Picheta2016-03-231-25/+110
| |\ \ \
| | * | | Modified and more reliable kqueue.nim, made according to openbsd/netbsd/freeb...cheatfate2016-03-181-25/+110
| | |/ /
| * | | Merge pull request #3981 from nim-lang/locks-lock-templateDominik Picheta2016-03-231-0/+10
| |\ \ \
| | * | | Documentation for `withLock`.Dominik Picheta2016-03-231-0/+2
| | * | | Rename locks.lock tmplt to withLock and change body to untyped.Dominik Picheta2016-03-231-1/+1
| | * | | Implement a `lock` template in `locks` module.Dominik Picheta2016-03-181-0/+8
| * | | | Merge pull request #3603 from rgv151/patch-global-log-levelAndreas Rumpf2016-03-231-6/+7
| |\ \ \ \
| | * \ \ \ Merge branch 'master' of https://github.com/Araq/Nim into patch-global-log-levelBruce Doan2016-01-2057-2932/+2656
| | |\ \ \ \
| | * | | | | respect global log filter levelBruce Doan2015-11-281-6/+7
| * | | | | | Merge pull request #3946 from def-/strutils-joinAndreas Rumpf2016-03-231-11/+15
| |\ \ \ \ \ \
| | * | | | | | Make strutils.join with with generic openarraysdef2016-03-061-11/+15
| * | | | | | | Merge pull request #3963 from def-/compiler-dirAndreas Rumpf2016-03-231-0/+21
| |\ \ \ \ \ \ \
| | * | | | | | | Explicitly return falsedef2016-03-181-1/+1
| | * | | | | | | Comment to explain not opening directories in open()def2016-03-171-0/+3
| | * | | | | | | Don't check opened file for directory in nimscriptdef2016-03-161-2/+2
| | * | | | | | | Don't open directories as filesdef2016-03-141-0/+18
| * | | | | | | | Merge pull request #3990 from yglukhov/js-tables-fixAndreas Rumpf2016-03-221-1/+4
| |\ \ \ \ \ \ \ \ | | |_|_|_|_|_|/ / | |/| | | | | | |
| | * | | | | | | Fixed Table::del in JSYuriy Glukhov2016-03-211-1/+4
| | |/ / / / / /
| * | | | | | | Merge pull request #3980 from pgkos/rational-subtraction-fixDennis Felsing2016-03-181-1/+1
| |\ \ \ \ \ \ \ | | |_|_|_|_|/ / | |/| | | | | |
| | * | | | | | Fixed a typo in proc `-`(x: T, y: Rational[T])pgkos2016-03-181-1/+1
| * | | | | | | Merge pull request #3976 from gmpreussner/develDominik Picheta2016-03-181-0/+1
| |\ \ \ \ \ \ \ | | |/ / / / / / | |/| | | | | |
| | * | | | | | Setting TAU to 2 * PIgmpreussner2016-03-171-1/+1
| | * | | | | | Added TAU constant.gmpreussner2016-03-171-0/+1
| * | | | | | | Merge pull request #3971 from gmpreussner/develDominik Picheta2016-03-171-3/+3
| |\| | | | | |
| | * | | | | | Renamed local variable to avoid compiler warning.gmpreussner2016-03-161-3/+3
| * | | | | | | Merge pull request #3966 from gmpreussner/develAndreas Rumpf2016-03-161-8/+8
| |\| | | | | |
p">(curr); curr.clear(); } } //:: Check types going in and out of all recipes with headers. :(scenarios transform) :(scenario recipe_headers_are_checked) % Hide_errors = true; recipe add2 x:number, y:number -> z:number [ local-scope load-ingredients z:address:number <- copy 0/raw reply z ] +error: add2: replied with the wrong type at 'reply z' :(before "End One-time Setup") Transform.push_back(check_header_products); :(code) void check_header_products(const recipe_ordinal r) { const recipe& rr = Recipe[r]; if (rr.products.empty()) return; trace(9991, "transform") << "--- checking reply instructions against header for " << rr.name << end(); for (long long int i = 0; i < SIZE(rr.steps); ++i) { const instruction& inst = rr.steps.at(i); if (inst.operation != REPLY) continue; if (SIZE(rr.products) != SIZE(inst.ingredients)) { raise_error << maybe(rr.name) << "tried to reply the wrong number of products in '" << inst.to_string() << "'\n" << end(); } for (long long int i = 0; i < SIZE(rr.products); ++i) { if (!types_match(rr.products.at(i), inst.ingredients.at(i))) { raise_error << maybe(rr.name) << "replied with the wrong type at '" << inst.to_string() << "'\n" << end(); } } } } //: Deduce types from the header if possible. :(scenarios run) :(scenario deduce_instruction_types_from_recipe_header) recipe main [ 1:number/raw <- add2 3, 5 ] recipe add2 x:number, y:number -> z:number [ local-scope load-ingredients z <- add x, y # no type for z reply z ] +mem: storing 8 in location 1 :(before "Transform.push_back(transform_names)") Transform.push_back(deduce_types_from_header); :(code) void deduce_types_from_header(const recipe_ordinal r) { recipe& rr = Recipe[r]; if (rr.products.empty()) return; trace(9991, "transform") << "--- deduce types from header for " << rr.name << end(); map<string, const type_tree*> header; for (long long int i = 0; i < SIZE(rr.ingredients); ++i) { header[rr.ingredients.at(i).name] = rr.ingredients.at(i).type; } for (long long int i = 0; i < SIZE(rr.products); ++i) { header[rr.products.at(i).name] = rr.products.at(i).type; } for (long long int i = 0; i < SIZE(rr.steps); ++i) { instruction& inst = rr.steps.at(i); trace(9992, "transform") << inst.to_string() << end(); for (long long int i = 0; i < SIZE(inst.ingredients); ++i) { if (inst.ingredients.at(i).type) continue; if (header.find(inst.ingredients.at(i).name) == header.end()) { raise << maybe(rr.name) << "unknown variable " << inst.ingredients.at(i).name << " in '" << inst.to_string() << "'\n" << end(); continue; } inst.ingredients.at(i).type = new type_tree(*header[inst.ingredients.at(i).name]); trace(9993, "transform") << "type of " << inst.ingredients.at(i).name << " is " << dump_types(inst.ingredients.at(i)) << end(); } for (long long int i = 0; i < SIZE(inst.products); ++i) { if (inst.products.at(i).type) continue; if (header.find(inst.products.at(i).name) == header.end()) { raise << maybe(rr.name) << "unknown variable " << inst.products.at(i).name << " in '" << inst.to_string() << "'\n" << end(); continue; } inst.products.at(i).type = new type_tree(*header[inst.products.at(i).name]); trace(9993, "transform") << "type of " << inst.products.at(i).name << " is " << dump_types(inst.products.at(i)) << end(); } } } //: One final convenience: no need to say what to return if the information is //: in the header. :(scenario reply_based_on_header) recipe main [ 1:number/raw <- add2 3, 5 ] recipe add2 x:number, y:number -> z:number [ local-scope load-ingredients z <- add x, y reply ] +mem: storing 8 in location 1 :(before "End Rewrite Instruction(curr, recipe result)") if (curr.name == "reply" && curr.ingredients.empty()) { for (long long int i = 0; i < SIZE(result.products); ++i) { curr.ingredients.push_back(result.products.at(i)); } } :(scenario reply_on_fallthrough_based_on_header) recipe main [ 1:number/raw <- add2 3, 5 ] recipe add2 x:number, y:number -> z:number [ local-scope load-ingredients z <- add x, y ] +transform: reply z:number +mem: storing 8 in location 1 :(after "int main") Transform.push_back(deduce_fallthrough_reply); :(code) void deduce_fallthrough_reply(const recipe_ordinal r) { recipe& rr = Recipe[r]; if (rr.products.empty()) return; if (rr.steps.empty()) return; if (rr.steps.at(SIZE(rr.steps)-1).name != "reply") { instruction inst; inst.operation = REPLY; inst.name = "reply"; for (long long int i = 0; i < SIZE(rr.products); ++i) { inst.ingredients.push_back(rr.products.at(i)); } rr.steps.push_back(inst); } } :(scenario reply_on_fallthrough_already_exists) recipe main [ 1:number/raw <- add2 3, 5 ] recipe add2 x:number, y:number -> z:number [ local-scope load-ingredients z <- add x, y # no type for z reply z ] +transform: reply z -transform: reply z:number +mem: storing 8 in location 1