no ropes WIP (#20433)
* refactorings in preparation for ropes elimination of the C code generator; mostly the usual ': Rope' -> 'result: var Rope' rewrite * rewrote ccgcalls.nim * refactored ccgexprs.nim * ccgliterals: refactoring * refactoring: code dealing with name mangling * refactoring: getRecordFieldsAux * ropes are strings (insert obscene joke here) * optimize JS code gen * optimizations and code improvements * more optimizations * final cleanups
This commit is contained in:
parent
805186809c
commit
ca1f3f36b9
24 changed files with 1058 additions and 1002 deletions
|
|
@ -12,9 +12,11 @@
|
|||
# the data structures here are used in various places of the compiler.
|
||||
|
||||
import
|
||||
ast, hashes, intsets, strutils, options, lineinfos, ropes, idents, rodutils,
|
||||
ast, hashes, intsets, options, lineinfos, ropes, idents, rodutils,
|
||||
msgs
|
||||
|
||||
import strutils except addf
|
||||
|
||||
when defined(nimPreviewSlimSystem):
|
||||
import std/assertions
|
||||
|
||||
|
|
@ -258,7 +260,7 @@ proc makeYamlString*(s: string): Rope =
|
|||
# this could trigger InternalError(111). See the ropes module for
|
||||
# further information.
|
||||
const MaxLineLength = 64
|
||||
result = nil
|
||||
result = ""
|
||||
var res = "\""
|
||||
for i in 0..<s.len:
|
||||
if (i + 1) mod MaxLineLength == 0:
|
||||
|
|
@ -274,9 +276,9 @@ proc flagsToStr[T](flags: set[T]): Rope =
|
|||
if flags == {}:
|
||||
result = rope("[]")
|
||||
else:
|
||||
result = nil
|
||||
result = ""
|
||||
for x in items(flags):
|
||||
if result != nil: result.add(", ")
|
||||
if result != "": result.add(", ")
|
||||
result.add(makeYamlString($x))
|
||||
result = "[" & result & "]"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue