summary refs log tree commit diff stats
path: root/compiler/sigmatch.nim
Commit message (Collapse)AuthorAgeFilesLines
* gc: destructors is beginning to work (#10483)Andreas Rumpf2019-01-291-0/+5
| | | | | | | | | | | | | | | | * kochdocs.nim: code cleanup * docgen: nicer indentation * parser.nim: code cleanup * fixes #10458 * make tests green again * make =destroy mixins * gc:destructors: produced C code is almost working * --gc:destructors simple program compiles (but leaks memory) * gc:destructors make examples compile in C++ mode * destructors: string implementation bugfixes * strs.nim: minor code cleanup * destructors: builtin seqs are beginning to work * remove debugging helpers
* Restrict ptr/ref to ptr/ref implicit conversion (#10411)LemonBoy2019-01-221-1/+1
| | | | | | | | * Restrict ptr/ref to ptr/ref implicit conversion Fixes #10409 * Make the ptr conversions explicit in db_odbc
* Fix subtype conversion w/ varargs arguments (#10402)LemonBoy2019-01-211-2/+3
| | | | | | | | | The type matching is done on the `T` of the `varargs[T]` so the conversion must be performed to `T` and not to the whole type. This problem is only noticeable with the cpp backend since C doesn't give a damn shit about your fucking (wrong) types. Fixes #9845
* fixes #10075 [backport]Araq2019-01-131-2/+1
|
* C++: make async tests green on WindowsAraq2018-12-211-5/+5
|
* More converter fixes (#9737)cooldome2018-11-261-5/+13
| | | | | | * fixes #9735 * fixes #9736 * fixes #3503
* Fixes multiple bugs with sink arguments (#9802)cooldome2018-11-261-4/+4
| | | | | | * fixes #9781 * fix spacing
* Converter bug fixes (#9700)cooldome2018-11-151-2/+8
| | | | | * Fixes #9698 * Fixes #9699
* added first version of a nimfind tool for the poor souls that don't have a ↵Andreas Rumpf2018-11-141-2/+2
| | | | good nimsuggest integretation
* make Nim take roughly 100MB less RAM for bootstrapping via a new compiler ↵Andreas Rumpf2018-11-071-1/+1
| | | | switch -d:leanCompiler; useful for the Raberry PI
* compiler cleanup: flag tfOldSchoolExprStmt is goneAraq2018-11-061-6/+3
|
* Fixes 6544 (#9427)LemonBoy2018-10-191-0/+10
| | | | | | | | | | * Fix call to converters with var/lent args Fixes #6544 * Fix printing of lent types * lent is only valid for result types
* replace deprecated `safeAdd` with `add` (#9416)Miran2018-10-181-4/+4
|
* implement sizeof and alignof operator (manually squashed #5664) (#9356)Timothee Cour2018-10-141-1/+0
|
* Unchecked arrays now have their own type (#9267)LemonBoy2018-10-101-1/+8
|
* Prevent the construction of recursive tyStatic types (#9256)LemonBoy2018-10-091-4/+7
| | | Fixes #9255
* fixes #4435 (#9185)jcosborn2018-10-091-1/+1
|
* fixes #7351Araq2018-10-021-1/+3
|
* fixes #8043Araq2018-09-031-0/+3
|
* Do not materialize empty varargs[untyped] arrays (#8715)LemonBoy2018-08-311-6/+17
| | | | | | | | | When an empty nkArgList `varargs[untyped]` is passed around it is now reused for efficiency sake and to prevent the introduction of a spurious element: before this commit we'd pass the caller a nkArgList[nkHiddenStdConv[nkBracket]] node instead of just an empty nkArgList. Fixes #8706
* introduce precise string '[]', '[]=' accessors; fixes #8049 (#8817)Andreas Rumpf2018-08-301-0/+9
|
* fixes #7854Araq2018-08-301-1/+2
|
* Fix #8126 (#8712)zah2018-08-211-1/+2
| | | | | | This is a temporary fix that will be reworked in a follow up commit that aims to eliminate the tfExplicit flag from the compiler. The complete and proper fix was considered too risky for inclusion just before our 0.19 release.
* changes how the now illegal 'string == nil' comparison is detectedAndreas Rumpf2018-08-151-6/+2
|
* Merge branch 'devel' into araq-miscAraq2018-08-131-0/+4
|\
| * Converters to take into account constraints. Fixes #7520 (#8593)cooldome2018-08-131-0/+4
| |
* | WIP: disallow 'nil' for strings and seqsAndreas Rumpf2018-08-131-6/+16
|/
* fixes #6255, add `system.ashr` arithmetic right shift (#8547)andri lim2018-08-071-0/+4
|
* sigmatch: no trailing whitespaceAndreas Rumpf2018-07-171-5/+5
|
* Do not crash while instantiating a generic outside a call (#8279)LemonBoy2018-07-141-1/+4
| | | Fixes #8270
* Handle subtype relations for converter parameters (#8248)LemonBoy2018-07-091-2/+7
| | | Fixes #7098
* Reset typedescMatched before paramTypesMatch (#8250)LemonBoy2018-07-091-0/+3
| | | | | The flag should not be carried out across different parameters. Fixes #7794
* Fix comparison of tyGenericBody in typerel (#8045)LemonBoy2018-07-071-1/+1
| | | | | | As shown in #7734 and #7733 the logic in typerel fails to determine that `type Foo` and `type Foo` are indeed equal. Fixes #7734
* Error out if vararg match isn't an exact one (#8186)LemonBoy2018-07-031-1/+11
| | | Fixes #8172
* Merge pull request #7736 from cooldome/range_float_typeAndreas Rumpf2018-06-271-14/+16
|\ | | | | Language feature: range float types
| * manual merge 2cooldome2018-06-121-1/+1
| |
| * merge develcooldome2018-06-121-27/+38
| |\
| * | style fixes, typoscooldome2018-06-121-5/+5
| | |
| * | remove underscorescooldome2018-06-111-5/+5
| | |
| * | fix commentscooldome2018-06-101-16/+11
| | |
| * | merge develcooldome2018-06-101-49/+63
| |\ \
| * \ \ merge develcooldome2018-04-291-7/+19
| |\ \ \
| * | | | Implement float range typescooldome2018-04-261-13/+20
| | | | |
* | | | | requested pull-request changesZahary Karadjov2018-06-161-10/+10
| | | | |
* | | | | allow referencing other parameters in default parameter valuesZahary Karadjov2018-06-161-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fix #7756 fix #1201 fix #7000 fix #3002 fix #1046
* | | | | fixes #7222; fixes #5595; fixes #3747Zahary Karadjov2018-06-161-5/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * late instantiation for the generic procs' default param values * automatic mixin behaviour in concepts Other fixes: * don't render the automatically inserted default params in calls * better rendering of tyFromExpr
* | | | | A minimal patch enabling the new typedesc and static types syntaxZahary Karadjov2018-06-161-5/+9
| | | | |
* | | | | implements a --nep1:on switch to make the compiler enforce the naming ↵Andreas Rumpf2018-06-131-1/+1
| |_|_|/ |/| | | | | | | | | | | conventions outlined in NEP-1
* | | | Merge pull request #7981 from cooldome/Fix_-7980Andreas Rumpf2018-06-121-2/+6
|\ \ \ \ | | | | | | | | | | Fixes 7980
| * | | | style improvementscooldome2018-06-121-2/+2
| | | | |
s="p">; if(barwin == ev->window) { x = 0; for(a.i = 0; a.i < ntags; a.i++) { x += textw(tags[a.i]); if(ev->x < x) { if(ev->button == Button1) view(&a); else if(ev->button == Button3) toggleview(&a); return; } } } else if((c = getclient(ev->window))) { focus(c); switch(ev->button) { default: break; case Button1: if(!c->ismax && (arrange == dofloat || c->isfloat)) { restack(c); movemouse(c); } break; case Button2: zoom(NULL); break; case Button3: if(!c->ismax && (arrange == dofloat || c->isfloat)) { restack(c); resizemouse(c); } break; } } } static void configurerequest(XEvent *e) { unsigned long newmask; Client *c; XConfigureRequestEvent *ev = &e->xconfigurerequest; XEvent synev; XWindowChanges wc; if((c = getclient(ev->window))) { gravitate(c, True); if(ev->value_mask & CWX) c->x = ev->x; if(ev->value_mask & CWY) c->y = ev->y; if(ev->value_mask & CWWidth) c->w = ev->width; if(ev->value_mask & CWHeight) c->h = ev->height; if(ev->value_mask & CWBorderWidth) c->border = ev->border_width; gravitate(c, False); wc.x = c->x; wc.y = c->y; wc.width = c->w; wc.height = c->h; newmask = ev->value_mask & (~(CWSibling | CWStackMode | CWBorderWidth)); if(newmask) XConfigureWindow(dpy, c->win, newmask, &wc); else { synev.type = ConfigureNotify; synev.xconfigure.display = dpy; synev.xconfigure.event = c->win; synev.xconfigure.window = c->win; synev.xconfigure.x = c->x; synev.xconfigure.y = c->y; synev.xconfigure.width = c->w; synev.xconfigure.height = c->h; synev.xconfigure.border_width = c->border; synev.xconfigure.above = None; /* Send synthetic ConfigureNotify */ XSendEvent(dpy, c->win, True, NoEventMask, &synev); } XSync(dpy, False); if(c->isfloat) resize(c, False, TopLeft); else arrange(NULL); } else { wc.x = ev->x; wc.y = ev->y; wc.width = ev->width; wc.height = ev->height; wc.border_width = ev->border_width; wc.sibling = ev->above; wc.stack_mode = ev->detail; XConfigureWindow(dpy, ev->window, ev->value_mask, &wc); XSync(dpy, False); } } static void destroynotify(XEvent *e) { Client *c; XDestroyWindowEvent *ev = &e->xdestroywindow; if((c = getclient(ev->window))) unmanage(c); } static void enternotify(XEvent *e) { Client *c; XCrossingEvent *ev = &e->xcrossing; if(ev->mode != NotifyNormal || ev->detail == NotifyInferior) return; if((c = getclient(ev->window)) || (c = getctitle(ev->window))) focus(c); else if(ev->window == root) { issel = True; XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); drawall(); } } static void expose(XEvent *e) { Client *c; XExposeEvent *ev = &e->xexpose; if(ev->count == 0) { if(barwin == ev->window) drawstatus(); else if((c = getctitle(ev->window))) drawtitle(c); } } static void keypress(XEvent *e) { static unsigned int len = sizeof(key) / sizeof(key[0]); unsigned int i; KeySym keysym; XKeyEvent *ev = &e->xkey; keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0); for(i = 0; i < len; i++) { if(keysym == key[i].keysym && CLEANMASK(key[i].mod) == CLEANMASK(ev->state)) { if(key[i].func) key[i].func(&key[i].arg); return; } } } static void leavenotify(XEvent *e) { XCrossingEvent *ev = &e->xcrossing; if((ev->window == root) && !ev->same_screen) { issel = False; drawall(); } } static void mappingnotify(XEvent *e) { XMappingEvent *ev = &e->xmapping; XRefreshKeyboardMapping(ev); if(ev->request == MappingKeyboard) grabkeys(); } static void maprequest(XEvent *e) { static XWindowAttributes wa; XMapRequestEvent *ev = &e->xmaprequest; if(!XGetWindowAttributes(dpy, ev->window, &wa)) return; if(wa.override_redirect) { XSelectInput(dpy, ev->window, (StructureNotifyMask | PropertyChangeMask)); return; } if(!getclient(ev->window)) manage(ev->window, &wa); } static void propertynotify(XEvent *e) { Client *c; Window trans; XPropertyEvent *ev = &e->xproperty; if(ev->state == PropertyDelete) return; /* ignore */ if((c = getclient(ev->window))) { if(ev->atom == wmatom[WMProtocols]) { c->proto = getproto(c->win); return; } switch (ev->atom) { default: break; case XA_WM_TRANSIENT_FOR: XGetTransientForHint(dpy, c->win, &trans); if(!c->isfloat && (c->isfloat = (trans != 0))) arrange(NULL); break; case XA_WM_NORMAL_HINTS: setsize(c); break; } if(ev->atom == XA_WM_NAME || ev->atom == netatom[NetWMName]) { settitle(c); drawtitle(c); } } } static void unmapnotify(XEvent *e) { Client *c; XUnmapEvent *ev = &e->xunmap; if((c = getclient(ev->window))) unmanage(c); } /* extern */ void (*handler[LASTEvent]) (XEvent *) = { [ButtonPress] = buttonpress, [ConfigureRequest] = configurerequest, [DestroyNotify] = destroynotify, [EnterNotify] = enternotify, [LeaveNotify] = leavenotify, [Expose] = expose, [KeyPress] = keypress, [MappingNotify] = mappingnotify, [MapRequest] = maprequest, [PropertyNotify] = propertynotify, [UnmapNotify] = unmapnotify }; void grabkeys() { static unsigned int len = sizeof(key) / sizeof(key[0]); unsigned int i; KeyCode code; XUngrabKey(dpy, AnyKey, AnyModifier, root); for(i = 0; i < len; i++) { code = XKeysymToKeycode(dpy, key[i].keysym); XGrabKey(dpy, code, key[i].mod, root, True, GrabModeAsync, GrabModeAsync); XGrabKey(dpy, code, key[i].mod | LockMask, root, True, GrabModeAsync, GrabModeAsync); XGrabKey(dpy, code, key[i].mod | NUMLOCKMASK, root, True, GrabModeAsync, GrabModeAsync); XGrabKey(dpy, code, key[i].mod | NUMLOCKMASK | LockMask, root, True, GrabModeAsync, GrabModeAsync); } }