Skip to content

Commit

Permalink
minor cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
Araq committed Dec 11, 2018
1 parent 5dc83d0 commit c682671
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 18 deletions.
13 changes: 6 additions & 7 deletions compiler/commands.nim
Original file line number Diff line number Diff line change
Expand Up @@ -619,13 +619,12 @@ proc processSwitch*(switch, arg: string, pass: TCmdLinePass, info: TLineInfo;
incl(conf.globalOptions, optRun)
of "errormax":
expectArg(conf, switch, arg, pass, info)
conf.errorMax = block:
# Note: `nim check` (etc) can overwrite this.
# `0` is meaningless, give it a useful meaning as in clang's -ferror-limit
# If user doesn't set this flag and the code doesn't either, it'd
# have the same effect as errorMax = 1
let ret = parseInt(arg)
if ret == 0: high(int) else: ret
# Note: `nim check` (etc) can overwrite this.
# `0` is meaningless, give it a useful meaning as in clang's -ferror-limit
# If user doesn't set this flag and the code doesn't either, it'd
# have the same effect as errorMax = 1
let ret = parseInt(arg)
conf.errorMax = if ret == 0: high(int) else: ret
of "verbosity":
expectArg(conf, switch, arg, pass, info)
let verbosity = parseInt(arg)
Expand Down
2 changes: 1 addition & 1 deletion doc/advopt.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Advanced options:
value = number of processors (0 for auto-detect)
--incremental:on|off only recompile the changed modules (experimental!)
--verbosity:0|1|2|3 set Nim's verbosity level (1 is default)
--errorMax:int stop after n errors in semantic pass; 0 means unlimited
--errorMax:N stop compilation after N errors; 0 means unlimited
--experimental:$1
enable experimental language feature
-v, --version show detailed version information
11 changes: 1 addition & 10 deletions doc/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -263,17 +263,8 @@ Take advantage of no implicit bool conversion
doAssert isValid() == true
doAssert isValid() # preferred
.. _immediately_invoked_lambdas:
Immediately invoked lambdas (https://en.wikipedia.org/wiki/Immediately-invoked_function_expression)

.. code-block:: nim
let a = (proc (): auto = getFoo())()
let a = block: # preferred
getFoo()
.. _design_for_mcs:
Design with method call syntax (UFCS in other languages) chaining in mind
Design with method call syntax chaining in mind

.. code-block:: nim
Expand Down

0 comments on commit c682671

Please sign in to comment.