summary refs log tree commit diff stats
path: root/tests/destructor
Commit message (Expand)AuthorAgeFilesLines
* fixes #18130 (#18407)Andreas Rumpf2021-07-011-16/+71
* Add some tests (#18333)Antonis Geralis2021-06-231-2/+70
* document macros.unpackVarargs (#18106)Timothee Cour2021-05-311-0/+1
* Remove confusing <//> (#17830)flywind2021-04-261-1/+6
* close #17636 (#17643)flywind2021-04-061-2/+2
* Fixes #17450 (#17477)Clyybber2021-03-231-1/+12
* Revert "Fixes #17450 (#17474)" (#17476)Clyybber2021-03-231-12/+1
* Fixes #17450 (#17474)Clyybber2021-03-231-1/+12
* Revert "Revert "close #16607 add testcase (#17317)" (#17336)" (#17347)Clyybber2021-03-121-0/+24
* Revert "close #16607 add testcase (#17317)" (#17336)Clyybber2021-03-111-24/+0
* close #9440 add testcase (#17316)flywind2021-03-091-0/+52
* close #16607 add testcase (#17317)flywind2021-03-091-0/+24
* deprecate newruntime (#17245)flywind2021-03-049-9/+9
* fixes #17198, DFA failure on large case stmts (#17210)Saem Ghani2021-03-021-0/+32
* close #5342 add testcase (#17230)flywind2021-03-021-0/+23
* remove all uses of condsyms symbols defined prior to bootstrap nim 0.20.0 (#1...Timothee Cour2021-02-171-2/+1
* don't introduce 'dispose', use '=dispose', fixes #17003 [backport:1.4] (#17062)Andreas Rumpf2021-02-171-1/+1
* use doAssert in tests (#16486)flywind2020-12-281-8/+8
* fixes #16365 [backport] (#16381)Andreas Rumpf2020-12-171-1/+31
* testament: error instead of silently ignore invalid targets; remove pointless...Timothee Cour2020-12-142-2/+2
* testament spec: remove errmsg alias of errormsg (#16188)Timothee Cour2020-11-291-1/+1
* make megatest consistent with unjoined tests wrt newlines, honor newlines in ...Timothee Cour2020-11-281-1/+1
* fix #15825 (#15894)cooldome2020-11-091-0/+11
* Add testcase for #14601 (#15677)Clyybber2020-10-221-1/+45
* renamed '=' to '=copy' [backport:1.2] (#15585)Andreas Rumpf2020-10-155-5/+5
* fixes #14983 (#15320)Andreas Rumpf2020-09-251-1/+14
* fixes #15361 (#15401)Andreas Rumpf2020-09-242-7/+10
* disable sink inference, only enable it for the stdlib. Reason: better source ...Andreas Rumpf2020-07-281-0/+1
* An optimizer for ARC (#14962)Andreas Rumpf2020-07-153-7/+15
* injectdestructors fixes and refactor (#14964)Clyybber2020-07-141-1/+0
* fixes #14925 (#14947)Andreas Rumpf2020-07-091-1/+8
* progressAraq2020-07-081-1/+1
* scoped memory management (#14790)Andreas Rumpf2020-07-041-19/+19
* Fix #14647 (#14776)Clyybber2020-06-281-1/+7
* Add testcases for #11811 and #14315 (#14726)Clyybber2020-06-191-1/+11
* Fix #14568 (#14583)Clyybber2020-06-071-0/+1
* fix #14421 items uses lent T (#14447)Timothee Cour2020-05-297-7/+7
* ARC/ORC: optimize s.setLen(0) to match the old runtime's behaviour (#14423)Andreas Rumpf2020-05-211-1/+1
* Small improvements for string and char repr with gc:arc (#14400)Clyybber2020-05-201-1/+1
* fix #14294 (#14301)cooldome2020-05-111-1/+25
* fix #14217 (#14218)cooldome2020-05-051-0/+26
* fixes #14159 [backport:1.2]Araq2020-05-021-0/+33
* fixes #14054 [backport:1.2] (#14061)Andreas Rumpf2020-04-301-1/+1
* Error -> Defect for defects (#13908)Jacek Sieka2020-04-283-8/+8
* fixes a critical =trace generation bug (see test case) (#14140)Andreas Rumpf2020-04-271-0/+16
* new implementations for --gc:orc (#14121)Andreas Rumpf2020-04-275-0/+6
* Implements RFCs #209 (#13995)cooldome2020-04-161-7/+3
* fixes #13782 (#13834)Andreas Rumpf2020-04-011-1/+21
* faster CIs (#13803)Miran2020-03-301-3/+3
* arc optimizations (#13325)Andreas Rumpf2020-03-184-3/+8
ss="w"> PToken): bool proc parseAtom(L: var TLexer, tok: PToken): bool = if tok.tokType == tkParLe: ppGetTok(L, tok) result = parseExpr(L, tok) if tok.tokType == tkParRi: ppGetTok(L, tok) else: lexMessage(L, errTokenExpected, "\')\'") elif tok.ident.id == ord(wNot): ppGetTok(L, tok) result = not parseAtom(L, tok) else: result = isDefined(tok.ident) #condsyms.listSymbols(); #writeln(tok.ident.s + ' has the value: ', result); ppGetTok(L, tok) proc parseAndExpr(L: var TLexer, tok: PToken): bool = var b: bool result = parseAtom(L, tok) while tok.ident.id == ord(wAnd): ppGetTok(L, tok) # skip "and" b = parseAtom(L, tok) result = result and b proc parseExpr(L: var TLexer, tok: PToken): bool = var b: bool result = parseAndExpr(L, tok) while tok.ident.id == ord(wOr): ppGetTok(L, tok) # skip "or" b = parseAndExpr(L, tok) result = result or b proc EvalppIf(L: var TLexer, tok: PToken): bool = ppGetTok(L, tok) # skip 'if' or 'elif' result = parseExpr(L, tok) if tok.tokType == tkColon: ppGetTok(L, tok) else: lexMessage(L, errTokenExpected, "\':\'") var condStack: seq[bool] condStack = @ [] proc doEnd(L: var TLexer, tok: PToken) = if high(condStack) < 0: lexMessage(L, errTokenExpected, "@if") ppGetTok(L, tok) # skip 'end' setlen(condStack, high(condStack)) type TJumpDest = enum jdEndif, jdElseEndif proc jumpToDirective(L: var TLexer, tok: PToken, dest: TJumpDest) proc doElse(L: var TLexer, tok: PToken) = if high(condStack) < 0: lexMessage(L, errTokenExpected, "@if") ppGetTok(L, tok) if tok.tokType == tkColon: ppGetTok(L, tok) if condStack[high(condStack)]: jumpToDirective(L, tok, jdEndif) proc doElif(L: var TLexer, tok: PToken) = var res: bool if high(condStack) < 0: lexMessage(L, errTokenExpected, "@if") res = EvalppIf(L, tok) if condStack[high(condStack)] or not res: jumpToDirective(L, tok, jdElseEndif) else: condStack[high(condStack)] = true proc jumpToDirective(L: var TLexer, tok: PToken, dest: TJumpDest) = var nestedIfs: int nestedIfs = 0 while True: if (tok.ident != nil) and (tok.ident.s == "@"): ppGetTok(L, tok) case whichKeyword(tok.ident) of wIf: Inc(nestedIfs) of wElse: if (dest == jdElseEndif) and (nestedIfs == 0): doElse(L, tok) break of wElif: if (dest == jdElseEndif) and (nestedIfs == 0): doElif(L, tok) break of wEnd: if nestedIfs == 0: doEnd(L, tok) break if nestedIfs > 0: Dec(nestedIfs) else: nil ppGetTok(L, tok) elif tok.tokType == tkEof: lexMessage(L, errTokenExpected, "@end") else: ppGetTok(L, tok) proc parseDirective(L: var TLexer, tok: PToken) = var res: bool key: string ppGetTok(L, tok) # skip @ case whichKeyword(tok.ident) of wIf: setlen(condStack, len(condStack) + 1) res = EvalppIf(L, tok) condStack[high(condStack)] = res if not res: jumpToDirective(L, tok, jdElseEndif) of wElif: doElif(L, tok) of wElse: doElse(L, tok) of wEnd: doEnd(L, tok) of wWrite: ppGetTok(L, tok) msgs.MessageOut(tokToStr(tok)) ppGetTok(L, tok) of wPutEnv: ppGetTok(L, tok) key = tokToStr(tok) ppGetTok(L, tok) os.putEnv(key, tokToStr(tok)) ppGetTok(L, tok) of wPrependEnv: ppGetTok(L, tok) key = tokToStr(tok) ppGetTok(L, tok) os.putEnv(key, tokToStr(tok) & os.getenv(key)) ppGetTok(L, tok) of wAppendenv: ppGetTok(L, tok) key = tokToStr(tok) ppGetTok(L, tok) os.putEnv(key, os.getenv(key) & tokToStr(tok)) ppGetTok(L, tok) else: lexMessage(L, errInvalidDirectiveX, tokToStr(tok)) proc confTok(L: var TLexer, tok: PToken) = ppGetTok(L, tok) while (tok.ident != nil) and (tok.ident.s == "@"): parseDirective(L, tok) # else: give the token to the parser proc checkSymbol(L: TLexer, tok: PToken) = if not (tok.tokType in {tkSymbol..pred(tkIntLit), tkStrLit..tkTripleStrLit}): lexMessage(L, errIdentifierExpected, tokToStr(tok)) proc parseAssignment(L: var TLexer, tok: PToken) = var s, val: string info: TLineInfo if (tok.ident.id == getIdent("-").id) or (tok.ident.id == getIdent("--").id): confTok(L, tok) # skip unnecessary prefix info = getLineInfo(L) # safe for later in case of an error checkSymbol(L, tok) s = tokToStr(tok) confTok(L, tok) # skip symbol val = "" while tok.tokType == tkDot: add(s, '.') confTok(L, tok) checkSymbol(L, tok) add(s, tokToStr(tok)) confTok(L, tok) if tok.tokType == tkBracketLe: # BUGFIX: val, not s! # BUGFIX: do not copy '['! confTok(L, tok) checkSymbol(L, tok) add(val, tokToStr(tok)) confTok(L, tok) if tok.tokType == tkBracketRi: confTok(L, tok) else: lexMessage(L, errTokenExpected, "\']\'") add(val, ']') if (tok.tokType == tkColon) or (tok.tokType == tkEquals): if len(val) > 0: add(val, ':') # BUGFIX confTok(L, tok) # skip ':' or '=' checkSymbol(L, tok) add(val, tokToStr(tok)) confTok(L, tok) # skip symbol while (tok.ident != nil) and (tok.ident.id == getIdent("&").id): confTok(L, tok) checkSymbol(L, tok) add(val, tokToStr(tok)) confTok(L, tok) processSwitch(s, val, passPP, info) proc readConfigFile(filename: string) = var L: TLexer tok: PToken stream: PLLStream new(tok) stream = LLStreamOpen(filename, fmRead) if stream != nil: openLexer(L, filename, stream) tok.tokType = tkEof # to avoid a pointless warning confTok(L, tok) # read in the first token while tok.tokType != tkEof: parseAssignment(L, tok) if len(condStack) > 0: lexMessage(L, errTokenExpected, "@end") closeLexer(L) if gVerbosity >= 1: rawMessage(hintConf, filename) proc getConfigPath(filename: string): string = # try local configuration file: result = joinPath(getConfigDir(), filename) if not ExistsFile(result): # try standard configuration file (installation did not distribute files # the UNIX way) result = joinPath([getPrefixDir(), "config", filename]) if not ExistsFile(result): result = "/etc/" & filename proc LoadSpecialConfig(configfilename: string) = if not (optSkipConfigFile in gGlobalOptions): readConfigFile(getConfigPath(configfilename)) proc LoadConfig(project: string) = var conffile, prefix: string # set default value (can be overwritten): if libpath == "": # choose default libpath: prefix = getPrefixDir() if (prefix == "/usr"): libpath = "/usr/lib/nimrod" elif (prefix == "/usr/local"): libpath = "/usr/local/lib/nimrod" else: libpath = joinPath(prefix, "lib") LoadSpecialConfig("nimrod.cfg") # read project config file: if not (optSkipProjConfigFile in gGlobalOptions) and (project != ""): conffile = changeFileExt(project, "cfg") if existsFile(conffile): readConfigFile(conffile)