Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
arnetheduck committed Dec 20, 2023
1 parent 697e1d4 commit 3236fce
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/phast.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1656,7 +1656,7 @@ when false:

var x: CountTable[string]

addQuitProc proc () {.noconv.} =
addQuitProc proc() {.noconv.} =
for k, v in pairs(x):
echo k
echo v
Expand Down
12 changes: 6 additions & 6 deletions src/phmsgs.nim
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,9 @@ proc newLineInfo*(fileInfoIdx: FileIndex; line, col: int): TLineInfo =
else:
result.col = -1

proc newLineInfo*(conf: ConfigRef; filename: AbsoluteFile; line, col: int): TLineInfo {.
inline
.} =
proc newLineInfo*(
conf: ConfigRef; filename: AbsoluteFile; line, col: int
): TLineInfo {.inline.} =
result = newLineInfo(fileInfoIdx(conf, filename), line, col)

const gCmdLineInfo* = newLineInfo(commandLineIdx, 1, 1)
Expand Down Expand Up @@ -818,9 +818,9 @@ template localError*(conf: ConfigRef; info: TLineInfo; arg: string) =
template message*(conf: ConfigRef; info: TLineInfo; msg: TMsgKind; arg = "") =
liMessage(conf, info, msg, arg, doNothing, instLoc())

proc warningDeprecated*(conf: ConfigRef; info: TLineInfo = gCmdLineInfo; msg = "") {.
inline
.} =
proc warningDeprecated*(
conf: ConfigRef; info: TLineInfo = gCmdLineInfo; msg = ""
) {.inline.} =
message(conf, info, warnDeprecated, msg)

proc internalErrorImpl(
Expand Down
11 changes: 6 additions & 5 deletions src/phrenderer.nim
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ proc atom(g: TOutput; n: PNode): string =
proc init(T: type TSrcLen; g: TSrcGen): T =
T(config: g.config, fid: g.fid, pendingWhitespace: -1)

proc gsub(g: var TOutput; n: PNode; flags: SubFlags = {}, extra = 0)
proc gsub(g: var TOutput; n: PNode; flags: SubFlags = {}; extra = 0)
proc gsons(
g: var TOutput; n: PNode; start: int = 0; theEnd: int = -1; flags: SubFlags = {}
)
Expand Down Expand Up @@ -582,12 +582,12 @@ proc glist(
subFlags: SubFlags = {};
)

proc lsub(g: TSrcGen; n: PNode; flags: SubFlags = {}, extra = 0): int =
proc lsub(g: TSrcGen; n: PNode; flags: SubFlags = {}; extra = 0): int =
var g = TSrcLen.init(g)
gsub(g, n, flags, extra)
g.lineLen

proc lsub(g: TSrcLen; n: PNode; flags: SubFlags = {}, extra = 0): int =
proc lsub(g: TSrcLen; n: PNode; flags: SubFlags = {}; extra = 0): int =
0

proc lsons(
Expand Down Expand Up @@ -1304,7 +1304,7 @@ proc isCustomLit(n: PNode): bool =

result = ident != nil and ident.s.startsWith('\'')

proc gsub(g: var TOutput; n: PNode; flags: SubFlags, extra: int) =
proc gsub(g: var TOutput; n: PNode; flags: SubFlags; extra: int) =
if isNil(n):
return

Expand Down Expand Up @@ -2031,7 +2031,8 @@ proc gsub(g: var TOutput; n: PNode; flags: SubFlags, extra: int) =
if n.len > 0 and n[0].kind != nkEmpty:
len(": ") + lsub(g, n[0])
else:
0)
0
)
# Semi-colon here is ugly but necessary for semantic equality, else we
# get different groupings of nkIdentDefs and their descendants
# TODO relaxing this to semantic equivalence would allow the use of `,`
Expand Down

0 comments on commit 3236fce

Please sign in to comment.