introduce temporary <//> for 'owned' to get this compile with 0.19 (#11145)
* introduce temporary <//> for 'owned' to get this compile with 0.19 * make newTable[string, owned Node]() compile (but it crashes) * make sink/owned parameters consistent * make actiontable test compile again * VM: support sytem.move; makes tests green
This commit is contained in:
parent
c94ab46923
commit
e1515b53d1
9 changed files with 69 additions and 46 deletions
|
|
@ -441,17 +441,17 @@ proc next*(c: var CfgParser): CfgEvent {.rtl, extern: "npc$1".} =
|
|||
|
||||
# ---------------- Configuration file related operations ----------------
|
||||
type
|
||||
Config* = OrderedTableRef[string, OrderedTableRef[string, string]]
|
||||
Config* = OrderedTableRef[string, <//>OrderedTableRef[string, string]]
|
||||
|
||||
proc newConfig*(): Config =
|
||||
## Create a new configuration table.
|
||||
## Useful when wanting to create a configuration file.
|
||||
result = newOrderedTable[string, OrderedTableRef[string, string]]()
|
||||
result = newOrderedTable[string, <//>OrderedTableRef[string, string]]()
|
||||
|
||||
proc loadConfig*(stream: Stream, filename: string = "[stream]"): Config =
|
||||
proc loadConfig*(stream: Stream, filename: string = "[stream]"): <//>Config =
|
||||
## Load the specified configuration from stream into a new Config instance.
|
||||
## `filename` parameter is only used for nicer error messages.
|
||||
var dict = newOrderedTable[string, OrderedTableRef[string, string]]()
|
||||
var dict = newOrderedTable[string, <//>OrderedTableRef[string, string]]()
|
||||
var curSection = "" ## Current section,
|
||||
## the default value of the current section is "",
|
||||
## which means that the current section is a common
|
||||
|
|
@ -481,7 +481,7 @@ proc loadConfig*(stream: Stream, filename: string = "[stream]"): Config =
|
|||
close(p)
|
||||
result = dict
|
||||
|
||||
proc loadConfig*(filename: string): Config =
|
||||
proc loadConfig*(filename: string): <//>Config =
|
||||
## Load the specified configuration file into a new Config instance.
|
||||
let file = open(filename, fmRead)
|
||||
let fileStream = newFileStream(file)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue