Merge branch 'master' into newparser
This commit is contained in:
commit
3c27d1a179
5 changed files with 64 additions and 21 deletions
|
|
@ -78,5 +78,5 @@ Advanced options:
|
|||
--listCmd list the commands used to execute external programs
|
||||
--parallelBuild=0|1|... perform a parallel build
|
||||
value = number of processors (0 for auto-detect)
|
||||
--verbosity:0|1|2|3 set Nimrod's verbosity level (0 is default)
|
||||
--verbosity:0|1|2|3 set Nimrod's verbosity level (1 is default)
|
||||
-v, --version show detailed version information
|
||||
|
|
|
|||
|
|
@ -68,6 +68,25 @@ ShadowIdent A local variable shadows another local
|
|||
User Some user defined warning.
|
||||
========================== ============================================
|
||||
|
||||
|
||||
Verbosity levels
|
||||
----------------
|
||||
|
||||
===== ============================================
|
||||
Level Description
|
||||
===== ============================================
|
||||
0 Minimal output level for the compiler.
|
||||
1 Displays compilation of all the compiled files, including those imported
|
||||
by other modules or through the `compile pragma<#compile-pragma>`_.
|
||||
This is the default level.
|
||||
2 Displays compilation statistics, enumerates the dynamic
|
||||
libraries that will be loaded by the final binary and dumps to
|
||||
standard output the result of applying `a filter to the source code
|
||||
<filters.html>`_ if any filter was used during compilation.
|
||||
3 In addition to the previous levels dumps a debug stack trace
|
||||
for compiler developers.
|
||||
===== ============================================
|
||||
|
||||
|
||||
Configuration files
|
||||
-------------------
|
||||
|
|
|
|||
18
doc/tut1.txt
18
doc/tut1.txt
|
|
@ -1311,6 +1311,24 @@ integer.
|
|||
echo(person[0]) # "Peter"
|
||||
echo(person[1]) # 30
|
||||
|
||||
# You don't need to declare tuples in a separate type section.
|
||||
var building: tuple[street: string, number: int]
|
||||
building = ("Rue del Percebe", 13)
|
||||
echo(building.street)
|
||||
|
||||
# The following line does not compile, they are different tuples!
|
||||
#person = building
|
||||
# --> Error: type mismatch: got (tuple[street: string, number: int])
|
||||
# but expected 'TPerson'
|
||||
|
||||
# The following works because the field names and types are the same.
|
||||
var teacher: tuple[name: string, age: int] = ("Mark", 42)
|
||||
person = teacher
|
||||
|
||||
Even though you don't need to declare a type for a tuple to use it, tuples
|
||||
created with different field names will be considered different objects despite
|
||||
having the same field types.
|
||||
|
||||
|
||||
Reference and pointer types
|
||||
---------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue