fix #12155, improve nimpretty's handling of pragmas (#17353)

This commit is contained in:
Miran 2021-03-12 15:34:42 +01:00 • committed by GitHub
commit 4f0bac791a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 1 deletions

View file

@ -514,7 +514,8 @@ proc emitTok*(em: var Emitter; L: Lexer; tok: Token) =
(not em.wasExportMarker or tok.tokType == tkCurlyDotLe): (not em.wasExportMarker or tok.tokType == tkCurlyDotLe):
wrSpace em wrSpace em
wr(em, $tok.tokType, ltSomeParLe) wr(em, $tok.tokType, ltSomeParLe)
rememberSplit(splitParLe) if tok.tokType != tkCurlyDotLe:
rememberSplit(splitParLe)
of closedPars: of closedPars:
wr(em, $tok.tokType, ltSomeParRi) wr(em, $tok.tokType, ltSomeParRi)
of tkColonColon: of tkColonColon:

View file

@ -843,3 +843,7 @@ type
SpinnyEvent2 = tuple SpinnyEvent2 = tuple
kind: EventKind kind: EventKind
payload: string payload: string
proc hid_open*(vendor_id: cushort; product_id: cushort; serial_number: cstring): ptr HidDevice {.
importc: "hid_open", dynlib: hidapi.}

View file

@ -856,3 +856,8 @@ type
SpinnyEvent2 = tuple SpinnyEvent2 = tuple
kind: EventKind kind: EventKind
payload: string payload: string
proc hid_open*(vendor_id: cushort; product_id: cushort;
serial_number: cstring): ptr HidDevice {.
importc: "hid_open", dynlib: hidapi.}