removes deprecated T/P types

This commit is contained in:
Araq 2018-11-16 13:27:46 +01:00
commit 3f6168b337
64 changed files with 43 additions and 276 deletions

View file

@ -244,8 +244,6 @@ when defined(windows) or defined(nimdoc):
AsyncEvent* = ptr AsyncEventImpl
Callback = proc (fd: AsyncFD): bool {.closure,gcsafe.}
{.deprecated: [TCompletionKey: CompletionKey, TAsyncFD: AsyncFD,
TCustomOverlapped: CustomOverlapped, TCompletionData: CompletionData].}
proc hash(x: AsyncFD): Hash {.borrow.}
proc `==`*(x: AsyncFD, y: AsyncFD): bool {.borrow.}
@ -1080,7 +1078,6 @@ else:
PDispatcher* = ref object of PDispatcherBase
selector: Selector[AsyncData]
{.deprecated: [TAsyncFD: AsyncFD, TCallback: Callback].}
proc `==`*(x, y: AsyncFD): bool {.borrow.}
proc `==`*(x, y: AsyncEvent): bool {.borrow.}

View file

@ -49,13 +49,11 @@ when sizeof(int) == 4: # 32bit
Raw = range[0..1073741823]
## The range of uint values that can be stored directly in a value slot
## when on a 32 bit platform
{.deprecated: [TRaw: Raw].}
elif sizeof(int) == 8: # 64bit
type
Raw = range[0'i64..4611686018427387903'i64]
## The range of uint values that can be stored directly in a value slot
## when on a 64 bit platform
{.deprecated: [TRaw: Raw].}
else:
{.error: "unsupported platform".}
@ -74,7 +72,6 @@ type
copyDone: int
next: PConcTable[K,V]
data: EntryArr
{.deprecated: [TEntry: Entry, TEntryArr: EntryArr].}
proc setVal[K,V](table: var PConcTable[K,V], key: int, val: int,
expVal: int, match: bool): int
@ -544,7 +541,6 @@ when not defined(testing) and isMainModule:
Data = tuple[k: string,v: TestObj]
PDataArr = array[0..numTests-1, Data]
Dict = PConcTable[string,TestObj]
{.deprecated: [TTestObj: TestObj, TData: Data].}
var
thr: array[0..numThreads-1, Thread[Dict]]

View file

@ -33,8 +33,6 @@ type
root: Node[T]
count: int
{.deprecated: [TCritBitTree: CritBitTree].}
proc len*[T](c: CritBitTree[T]): int =
## returns the number of elements in `c` in O(1).
result = c.count

View file

@ -44,8 +44,6 @@ type
data: TrunkSeq
a: array[0..33, int] # profiling shows that 34 elements are enough
{.deprecated: [TIntSet: IntSet, TTrunk: Trunk, TTrunkSeq: TrunkSeq].}
proc mustRehash(length, counter: int): bool {.inline.} =
assert(length > counter)
result = (length * 2 < counter * 3) or (length - counter < 4)

View file

@ -45,15 +45,6 @@ type
SomeLinkedNode*[T] = SinglyLinkedNode[T] | DoublyLinkedNode[T]
{.deprecated: [TDoublyLinkedNode: DoublyLinkedNodeObj,
PDoublyLinkedNode: DoublyLinkedNode,
TSinglyLinkedNode: SinglyLinkedNodeObj,
PSinglyLinkedNode: SinglyLinkedNode,
TDoublyLinkedList: DoublyLinkedList,
TSinglyLinkedRing: SinglyLinkedRing,
TDoublyLinkedRing: DoublyLinkedRing,
TSinglyLinkedList: SinglyLinkedList].}
proc initSinglyLinkedList*[T](): SinglyLinkedList[T] =
## creates a new singly linked list that is empty.
discard

View file

@ -46,8 +46,6 @@ type
data: seq[T]
rd, wr, count, mask: int
{.deprecated: [TQueue: Queue].}
proc initQueue*[T](initialSize: int = 4): Queue[T] =
## Create a new queue.
## Optionally, the initial capacity can be reserved via `initialSize` as a

View file

@ -39,8 +39,6 @@ type
data: KeyValuePairSeq[A]
counter: int
{.deprecated: [TSet: HashSet].}
template default[T](t: typedesc[T]): T =
## Used by clear methods to get a default value.
var v: T
@ -631,8 +629,6 @@ type
data: OrderedKeyValuePairSeq[A]
counter, first, last: int
{.deprecated: [TOrderedSet: OrderedSet].}
proc clear*[A](s: var OrderedSet[A]) =
## Clears the OrderedSet back to an empty state, without shrinking
## any of the existing storage. O(n) where n is the size of the hash bucket.

View file

@ -125,8 +125,6 @@ type
counter: int
TableRef*[A,B] = ref Table[A, B]
{.deprecated: [TTable: Table, PTable: TableRef].}
template maxHash(t): untyped = high(t.data)
template dataLen(t): untyped = len(t.data)
@ -520,8 +518,6 @@ type
counter, first, last: int
OrderedTableRef*[A, B] = ref OrderedTable[A, B]
{.deprecated: [TOrderedTable: OrderedTable, POrderedTable: OrderedTableRef].}
proc len*[A, B](t: OrderedTable[A, B]): int {.inline.} =
## returns the number of keys in ``t``.
result = t.counter
@ -795,7 +791,7 @@ proc getOrDefault*[A, B](t: OrderedTableRef[A, B], key: A): B =
getOrDefault(t[], key)
proc getOrDefault*[A, B](t: OrderedTableRef[A, B], key: A, default: B): B =
## retrieves the value at ``t[key]`` iff ``key`` is in ``t``. Otherwise,
## retrieves the value at ``t[key]`` iff ``key`` is in ``t``. Otherwise,
## ``default`` is returned.
getOrDefault(t[], key, default)
@ -892,8 +888,6 @@ type
counter: int
CountTableRef*[A] = ref CountTable[A]
{.deprecated: [TCountTable: CountTable, PCountTable: CountTableRef].}
proc len*[A](t: CountTable[A]): int =
## returns the number of keys in ``t``.
result = t.counter

View file

@ -213,7 +213,6 @@ when defined(windows):
maxCharSize: int32
defaultChar: array[0..1, char]
leadByte: array[0..12-1, char]
{.deprecated: [TCpInfo: CpInfo].}
proc getCPInfo(codePage: CodePage, lpCPInfo: var CpInfo): int32 {.
stdcall, importc: "GetCPInfo", dynlib: "kernel32".}

View file

@ -848,8 +848,6 @@ proc newHttpClient*(userAgent = defUserAgent,
type
AsyncHttpClient* = HttpClientBase[AsyncSocket]
{.deprecated: [PAsyncHttpClient: AsyncHttpClient].}
proc newAsyncHttpClient*(userAgent = defUserAgent,
maxRedirects = 5, sslContext = getDefaultSSL(),
proxy: Proxy = nil): AsyncHttpClient =
@ -1163,7 +1161,7 @@ proc requestAux(client: HttpClient | AsyncHttpClient, url: string,
{.multisync.} =
# Helper that actually makes the request. Does not handle redirects.
let requestUrl = parseUri(url)
if requestUrl.scheme == "":
raise newException(ValueError, "No uri scheme supplied.")

View file

@ -566,9 +566,6 @@ type
SqlParser* = object of SqlLexer ## SQL parser object
tok: Token
{.deprecated: [EInvalidSql: SqlParseError, PSqlNode: SqlNode,
TSqlNode: SqlNodeObj, TSqlParser: SqlParser, TSqlNodeKind: SqlNodeKind].}
proc newNode*(k: SqlNodeKind): SqlNode =
new(result)
result.kind = k

View file

@ -90,19 +90,19 @@ proc kind*(p: Peg): PegKind = p.kind
## Returns the *PegKind* of a given *Peg* object.
proc term*(p: Peg): string = p.term
## Returns the *string* representation of a given *Peg* variant object
## Returns the *string* representation of a given *Peg* variant object
## where present.
proc ch*(p: Peg): char = p.ch
## Returns the *char* representation of a given *Peg* variant object
## Returns the *char* representation of a given *Peg* variant object
## where present.
proc charChoice*(p: Peg): ref set[char] = p.charChoice
## Returns the *charChoice* field of a given *Peg* variant object
## Returns the *charChoice* field of a given *Peg* variant object
## where present.
proc nt*(p: Peg): NonTerminal = p.nt
## Returns the *NonTerminal* object of a given *Peg* variant object
## Returns the *NonTerminal* object of a given *Peg* variant object
## where present.
proc index*(p: Peg): range[0..MaxSubpatterns] = p.index
@ -137,7 +137,7 @@ proc flags*(nt: NonTerminal): set[NonTerminalFlag] = nt.flags
proc rule*(nt: NonTerminal): Peg = nt.rule
## Gets the *Peg* object representing the rule definition of the parent *Peg*
## object variant of a given *NonTerminal*.
## object variant of a given *NonTerminal*.
proc term*(t: string): Peg {.nosideEffect, rtl, extern: "npegs$1Str".} =
## constructs a PEG from a terminal string
@ -553,8 +553,6 @@ type
ml: int
origStart: int
{.deprecated: [TCaptures: Captures].}
proc bounds*(c: Captures,
i: range[0..MaxSubpatterns-1]): tuple[first, last: int] =
## returns the bounds ``[first..last]`` of the `i`'th capture.
@ -885,7 +883,7 @@ proc rawMatch*(s: string, p: Peg, start: int, c: var Captures): int
macro mkHandlerTplts(handlers: untyped): untyped =
# Transforms the handler spec in *handlers* into handler templates.
# The AST structure of *handlers[0]*:
#
#
# .. code-block::
# StmtList
# Call
@ -1009,7 +1007,7 @@ template eventParser*(pegAst, handlers: untyped): (proc(s: string): int) =
## echo opStack
##
## let pLen = parseArithExpr(txt)
##
##
## The *handlers* parameter consists of code blocks for *PegKinds*,
## which define the grammar elements of interest. Each block can contain
## handler code to be executed when the parser enters and leaves text

View file

@ -1987,8 +1987,6 @@ type
ffDecimal, ## use decimal floating point notation
ffScientific ## use scientific notation (using ``e`` character)
{.deprecated: [TFloatFormat: FloatFormatMode].}
proc formatBiggestFloat*(f: BiggestFloat, format: FloatFormatMode = ffDefault,
precision: range[-1..32] = 16;
decimalSep = '.'): string {.

View file

@ -300,8 +300,6 @@ proc scanDollar(p: var FormatParser, a: openarray[string], s: var string) =
type
Subex* = distinct string ## string that contains a substitution expression
{.deprecated: [TSubex: Subex].}
proc subex*(s: string): Subex =
## constructs a *substitution expression* from `s`. Currently this performs
## no syntax checking but this may change in later versions.

View file

@ -481,9 +481,6 @@ type
styleHidden, ## hidden text
styleStrikethrough ## strikethrough
{.deprecated: [TStyle: Style].}
{.deprecated: [styleUnknown: styleItalic].}
when not defined(windows):
var
gFG {.threadvar.}: int
@ -556,9 +553,6 @@ type
bg8Bit, ## 256-color (not supported, see ``enableTrueColors`` instead.)
bgDefault ## default terminal background color
{.deprecated: [TForegroundColor: ForegroundColor,
TBackgroundColor: BackgroundColor].}
when defined(windows):
var defaultForegroundColor, defaultBackgroundColor: int16 = 0xFFFF'i16 # Default to an invalid value 0xFFFF

View file

@ -298,9 +298,6 @@ type
TimeIntervalParts* = array[TimeUnit, int] # Array of Duration parts starts
TimesMutableTypes = DateTime | Time | Duration | TimeInterval
{.deprecated: [TMonth: Month, TWeekDay: WeekDay, TTime: Time,
TTimeInterval: TimeInterval, TTimeInfo: DateTime, TimeInfo: DateTime].}
const
secondsInMin = 60
secondsInHour = 60*60

View file

@ -18,8 +18,6 @@ type
Rune* = distinct RuneImpl ## type that can hold any Unicode character
Rune16* = distinct int16 ## 16 bit Unicode character
{.deprecated: [TRune: Rune, TRune16: Rune16].}
proc `<=%`*(a, b: Rune): bool = return int(a) <=% int(b)
proc `<%`*(a, b: Rune): bool = return int(a) <% int(b)
proc `==`*(a, b: Rune): bool = return int(a) == int(b)

View file

@ -145,8 +145,6 @@ type
testStartTime: float
testStackTrace: string
{.deprecated: [TTestStatus: TestStatus, TOutputLevel: OutputLevel]}
var
abortOnError* {.threadvar.}: bool ## Set to true in order to quit
## immediately on fail. Default is false,