Commit Graph

86 Commits

Author SHA1 Message Date
LemonBoy
e07ab06f0a Fix locals() interaction with generic types
Follow the same logic as semTupleFieldsConstr and only skip skVar since
we're gonna add a nkDefer anyway.

Fixes #8985
2018-09-21 22:35:54 +02:00
awr
e6a4213fae transformed {.reorder: on.} into {.experimental: codeReordering.}, added tests 2018-09-04 15:31:38 -05:00
Oscar Nihlgård
7dcf435b4b Fix abs & unary sub in semfold (#8724) 2018-08-22 15:59:33 +02:00
cooldome
404f0d64af Add sizeof for arrays of integral types (#8445) 2018-07-30 11:00:06 +02:00
Oscar Nihlgård
332469692d Bugfix for modules with multi byte characters in the name (#8319) 2018-07-14 16:00:51 +02:00
Vindaar
681d8e0749 Deprecate 'c', 'C' prefix for octal literals, fixes #8082 (#8178)
* deprecate `0c`, `0C` prefix for octal literals

Deprecates the previously allowed syntax of `0c` and `0C` as a prefix for
octal literals to bring the literals in line with the behavior of
`parseOct` from parseutils.

* add `msgKind` arg to `lexMessageLitNum` for deprecation messages

* change literal tests to check all valid integer literals

Also adds the `tinvaligintegerlit3` test to test for the (still)
invalid `0O` prefix.
2018-07-03 01:56:36 +02:00
Zahary Karadjov
31651ecd61 allow referencing other parameters in default parameter values
fix #7756
fix #1201
fix #7000
fix #3002
fix #1046
2018-06-16 16:46:32 +03:00
Oscar Nihlgård
eb8f15d97c Support multi byte characters in module names (#7916) 2018-05-31 10:38:43 +03:00
Araq
02b78d3f94 make tests green again 2018-05-14 21:38:18 +02:00
Andreas Rumpf
d8fde9daba make tests green 2018-05-05 21:45:07 +02:00
Oscar Nihlgård
cc0ca43743 Don't hide overflow/underflow/divbyzero in semfold (#7732)
* firstOrd/lastOrd bugfix
* Don't hide overflow/underflow/divbyzero in semfold
2018-05-02 08:54:09 +02:00
Andreas Rumpf
16b0bf6cca make memoization test compile again 2018-04-29 08:00:45 +02:00
zah
121b9e26fb Static[T] fixes (#7333)
* fix the usage of unresolved static[T] parameters in proc signatures
* fix tsametype and tmacrogenerics
* Allow creating composite type classes with concepts and using them in type signatures
* Allow integers to be used in ident concatenations
* Support using imported C++ generic types in proc signatures
* fixes #7230
* closes #7379
* re-enable some metatype tests
2018-03-24 15:28:09 +01:00
c-blake
551d7b7dc1 Add ability for users to elide ':' or '=' when CLI authors pass a (#7297)
* Add ability for users to elide ':' or '=' when CLI authors pass a
non-empty partial symbol table.  Behavior should be identical to the
old behavior if empty partial symbol tables are passed.  "Partialness"
of the symbol table refers to the fact that one need only specify
option keys that are toggles/booleans/do not take arguments, hence
the "NoArg" suffixes in shortNoArg and longNoArg.

commandLineParams() returns seq[TaintedString], so use that consistently
in getopt() and initOptParser(seq[TaintedString]) dropping the taint at
the quoting stage just as with the paramStr() logic.

Fix capitalization inconsistency of cmdLongOption.

Export OptParser.cmd and OptParser.pos so that, at least *in principle*,
users of this API can handle "--" option processing termination or some
"git-like" sub-command stop word with a separate option sub-syntax.
{ Eg., ``case p.key of "": echo "trailing non-option args: ", p.cmd[p.pos..^1]``
or ``case p.kind of cmdArgument: if p.key == "mysubcmd": ...``. }  Really,
searching for the last delimiter before p.pos is probably needed to frame
the trailing text..Not the nicest API, but still possible with effort.

* Make requested changes from string to seq[char]
(see https://github.com/nim-lang/Nim/pull/7297)

* Document new behavior and elaborate on some special cases.

* NoArg => NoVal to be less ambiguous/more clear.

* Add more documentation and an example snippet.

* Tweak language. Clarify still using ':'/'=' is ok.

* Add a test case for new NoVal behavior.
2018-03-08 08:12:34 +01:00
Araq
2c1f1f21bf fixes #3985 2018-02-10 21:20:48 +01:00
Araq
b57d14b1ae make more tests green 2018-02-10 20:55:22 +01:00
Araq
45437eb113 fixes #4220 2018-02-10 14:20:31 +01:00
Araq
be87fe9176 make tests green again 2017-12-15 13:24:47 +01:00
Fabian Keller
6df6ec27ec Improved collection-to-string behavior (#6825) 2017-12-14 14:02:13 +01:00
Andreas Rumpf
9460fcfed2 make tests green again 2017-11-21 12:29:58 +01:00
Lynn C. Rees
7f4248dc0c Move deprecated romans module from stdlib to Nimble package (#6660) 2017-11-15 17:28:00 +01:00
Araq
3174cfe55c make tests green again 2017-11-01 00:20:40 +01:00
Andreas Rumpf
7889692523 first implementation of package level types that allow forwarding across module boundaries 2017-10-28 15:28:59 +02:00
Andreas Rumpf
8cdd89f456 make tests green again 2017-10-10 09:34:03 +02:00
Andreas Rumpf
db0d353281 Merge branch 'stringify-array' of https://github.com/krux02/Nim into krux02-stringify-array 2017-10-09 23:46:24 +02:00
Andreas Rumpf
68c7da227f make tests green again 2017-10-01 07:46:13 +02:00
Andreas Rumpf
ddc131cf07 the parser finally parses 'echo {1,2}' as it should 2017-09-30 21:35:30 +02:00
Arne Döring
000b8afd26 Remove expr/stmt (#5857) 2017-07-25 09:28:23 +02:00
Arne Döring
ddea990a70 removed newString proc again, reverted some unnecesary changes 2017-07-24 23:21:51 +02:00
Varriount
a939a4b3a4 Merge pull request #5952 from Parashurama/fix_parseopt
Fix parseopt custom arguments
2017-06-13 04:11:58 -04:00
Parashurama
bbf9ef606d restrict casting for closure. (#5948); fixes #5742
* restrict casting for closure.

This commit forbid casting a closure to anything other than another
closure. use rawEnv/rawProc to access underlaying pointers.

* better error message for closure cast
* fixes #5742
2017-06-07 08:52:50 +02:00
Parashurama
27e2a34340 fixes parseopt/parseopt2 custom cmdline args. 2017-06-06 13:50:26 +02:00
Andreas Rumpf
880a525566 another attempt to get travis green 2017-03-29 11:47:44 +02:00
Eugene Kabanov
336a7c9b3f Fixes to support Dragonfly BSD. (#5552)
* Fix kqueue.nim and ansi_c.nim to support dragonfly.
* Fix ioselectors.nim, threads.nim to support dragonfly.
* Fix deprecated dealloc call in tioselectors.nim.
* Fix tfsmonitor.nim test to run only on Linux.
* Fix osproc.nim return wrong exit codes.
* Fix getAppFilename() for dragonfly.
* Fix proper exit code handling.
2017-03-17 08:22:11 +01:00
Andreas Rumpf
46efaf294b big compiler refactoring; avoid globals for multi method dispatcher generation 2017-02-22 16:27:52 +01:00
Araq
e236039d10 make tests on Windows green under --pedantic 2017-02-02 21:12:36 +01:00
Araq
c130a2af17 make tests green 2016-12-18 23:32:15 +01:00
Ruslan Mustakov
2c146445bc Added deques module, deprecating queues 2016-11-24 19:11:51 +07:00
Andreas Rumpf
0378f9980f fixed regressions 2016-03-29 12:19:49 +02:00
Andreas Rumpf
e50a7af5e2 make tests green again 2016-02-29 14:39:38 +01:00
Andreas Rumpf
c9966a3e17 use 'using' instead of 'sig' keyword; cleans up new features a bit 2016-02-29 12:19:54 +01:00
def
c50b5b62ef Fix a few deprecation warnings 2016-01-25 19:10:37 +01:00
Yuriy Glukhov
d2ecd84f67 JS: Corrected shift operators. Made casting between ints behave like C does. 2016-01-22 18:32:47 +02:00
Yuriy Glukhov
c0d0e5efd9 Unsigned arith corrected for JS 2016-01-21 17:00:42 +02:00
Federico Ceratto
05b856df23 Closes: #3611 2015-12-02 16:05:50 +00:00
Araq
d8b0edc323 Merge branch 'mget' of https://github.com/def-/Nim into def--mget
Conflicts:
	lib/pure/collections/critbits.nim
	lib/pure/collections/tables.nim
	lib/pure/xmltree.nim
	lib/system/sets.nim
	tests/collections/ttables.nim
	tests/collections/ttablesref.nim
2015-10-13 00:22:27 +02:00
Aman Gupta
2240fd3f3f add tfile/tline assertions for template expansion file/line 2015-10-06 15:47:07 -07:00
Araq
31bbc24462 minor testsuite cleanup 2015-09-10 13:19:13 +02:00
Adam Strzelecki
e80465dacf tests: Trim .nim files trailing whitespace
via OSX: find . -name '*.nim' -exec sed -i '' -E 's/[[:space:]]+$//' {} +
2015-09-04 23:04:32 +02:00
patrick dw
69e15ac32f renamed writeln to writeLine in tests 2015-06-19 01:34:34 -05:00