Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no ropes WIP #20433

Merged
merged 28 commits into from
Sep 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions compiler/ast.nim
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ const
mEqSet, mLeSet, mLtSet, mMulSet, mPlusSet, mMinusSet,
mConStrStr, mAppendStrCh, mAppendStrStr, mAppendSeqElem,
mInSet, mRepr, mOpenArrayToSeq}

generatedMagics* = {mNone, mIsolate, mFinished, mOpenArrayToSeq}
## magics that are generated as normal procs in the backend

Expand Down Expand Up @@ -1504,7 +1504,7 @@ proc mergeLoc(a: var TLoc, b: TLoc) =
if a.storage == low(typeof(a.storage)): a.storage = b.storage
a.flags.incl b.flags
if a.lode == nil: a.lode = b.lode
if a.r == nil: a.r = b.r
if a.r == "": a.r = b.r

proc newSons*(father: Indexable, length: int) =
setLen(father.sons, length)
Expand Down
10 changes: 6 additions & 4 deletions compiler/astalgo.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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:
Expand All @@ -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 & "]"

Expand Down
Loading