summary refs log tree commit diff stats
path: root/compiler/lookups.nim
Commit message (Collapse)AuthorAgeFilesLines
* Cosmetic compiler cleanup (#12718)Clyybber2019-11-281-32/+32
| | | | | | | | | | | | | | | | | | * Cleanup compiler code base * Unify add calls * Unify len invocations * Unify range operators * Fix oversight * Remove {.procvar.} pragma * initCandidate -> newCandidate where reasonable * Unify safeLen calls
* Fix spellings (#12277) [backport]Federico Ceratto2019-09-271-1/+1
|
* Small ast.nim cleanup (#12156)Clyybber2019-09-091-1/+1
| | | | | * Remove sonsLen * Use Indexable
* [refactoring] remove unused imports in the compiler and in some stdlib modulesAraq2019-07-181-1/+1
|
* balance space around emdash --Julian Fondren2019-04-291-1/+1
|
* add indent to ambiguous-identifier outputJulian Fondren2019-04-281-1/+1
|
* re-include ambiguous identifier in ambiguous identifier outputJulian Fondren2019-04-281-1/+2
|
* re-include module in ambiguous identifier outputJulian Fondren2019-04-281-1/+1
|
* provide more useful ambiguous-identifier error outputJulian Fondren2019-04-281-3/+3
|
* fixes #10251 (#10255)Arne Döring2019-01-101-1/+1
|
* [error messages, stacktraces] fix #8794 #9270 #9767 #9768 (#9766)Timothee Cour2019-01-081-1/+1
| | | | | | | | | | | | | | | | | | | * fixes #8794 : `Error: undeclared field: 'foo'` should show type (+ where type is defined) (hard to guess in generic code) * fixes #9270: `--listFullPaths` not honored by `declared in foo.nim` messages * fixes #9767: VM stacktrace doesn't honor --excessiveStackTrace:on * fixes #9768: VM stacktrace misses column info, can lead to ambiguous or harder to read stacktraces * refactors some col+1 code to col + ColOffset (self documents code) * make getProcHeader show declared info location also for types and all routine kinds (including macros,templates) instead of just (rather arbitrarily) for iterator,proc,func,method * --listFullPaths now is honored in more places * fix typo system/except.nim => lib/system/excpt.nim * remove substr(foo, 0) hack in compiler/vm.nim which seems old and not applicable anymore
* Deprecate gc v2 (#10151)Neelesh Chandola2019-01-011-1/+1
| | | | | | * Deprecate gc v2 * warnDeprecated now has custom messages
* fixes #10101 (#10103)Timothee Cour2018-12-271-1/+1
|
* change approachAndrii Riabushenko2018-12-091-2/+1
|
* Fix hintXDeclaredButNotUsed for enum fields marked as usedAndrii Riabushenko2018-12-081-1/+2
|
* fixes #9764Araq2018-11-231-1/+1
|
* improve the error message for 'attempt to redefine X'; fixes #447Andreas Rumpf2018-09-171-11/+17
|
* fixes #8066Araq2018-08-311-1/+1
|
* better formatting for recursive module dependency (#8735)Timothee Cour2018-08-231-1/+1
|
* sfForward is also sfReorder for skModule symbols (#8692)LemonBoy2018-08-211-1/+1
| | | | | Take this into account while searching for undefined forward references. Fixes #8665
* WIP: disallow 'nil' for strings and seqsAndreas Rumpf2018-08-131-1/+1
|
* use slashes instead of dots for pathsAndreas Rumpf2018-08-061-1/+1
|
* baby steps for incremental compilationAndreas Rumpf2018-05-301-5/+9
|
* refactoring: remove idents.legacy global variable and pass the IdentCache ↵Andreas Rumpf2018-05-271-13/+13
| | | | around explicitly
* remove more global variables in the Nim compilerAndreas Rumpf2018-05-271-1/+1
|
* make tests green againAndreas Rumpf2018-05-181-13/+15
|
* preparations of making compiler/msgs.nim free of global variablesAndreas Rumpf2018-05-171-1/+1
|
* options.nim: no global variables anymoreAndreas Rumpf2018-05-131-4/+4
|
* lookups compiles againAndreas Rumpf2018-05-101-56/+53
|
* Cpp codegen: handling of imported exceptions. Fixes #3571 (#7360)cooldome2018-04-101-2/+0
|
* Static[T] fixes (#7333)zah2018-03-241-1/+2
| | | | | | | | | | | * fix the usage of unresolved static[T] parameters in proc signatures * fix tsametype and tmacrogenerics * Allow creating composite type classes with concepts and using them in type signatures * Allow integers to be used in ident concatenations * Support using imported C++ generic types in proc signatures * fixes #7230 * closes #7379 * re-enable some metatype tests
* fixes #6965Araq2017-12-281-3/+4
|
* fixes #1860; macro generating a wrong nkSymChoice nodeAndreas Rumpf2017-10-301-2/+10
|
* deprecated unary '<'Andreas Rumpf2017-10-291-1/+1
|
* first implementation of package level types that allow forwarding across ↵Andreas Rumpf2017-10-281-1/+1
| | | | module boundaries
* first implementation of the 'func' keywordAndreas Rumpf2017-09-231-2/+4
|
* .pure enums are much more convenient to use nowAndreas Rumpf2017-09-171-1/+3
|
* compiler: better error messages (#5613)Andreas Rumpf2017-03-261-13/+20
|
* big compiler refactoring; avoid globals for multi method dispatcher generationAndreas Rumpf2017-02-221-1/+1
|
* More progress towards a working #3691.Dominik Picheta2017-02-031-1/+1
|
* WIP: `as` with generics.Dominik Picheta2017-02-021-0/+3
|
* implements module grouping for the import statementAndreas Rumpf2016-12-211-2/+2
|
* recursive modules are only detected to improve error messagesAndreas Rumpf2016-11-241-4/+13
|
* fixes #4555Andreas Rumpf2016-08-021-7/+14
|
* compiler almost free of deprecated expr/stmt namesAndreas Rumpf2016-07-301-2/+2
|
* Locate 'attempt to redefine' errors at the import statement rather than at ↵Kier Davis2016-07-301-0/+4
| | | | the first line of the imported module. Fixes #4541.
* fixes an valid 'T' is not used hintAndreas Rumpf2016-07-201-1/+2
|
* fixes #177Andreas Rumpf2016-05-111-3/+16
|
* first implementation of the new lambda-lifting pass; barely anything worksAndreas Rumpf2015-12-261-1/+1
|
* renamed inCompilesContext to compilesContextId; added test case for #3313Araq2015-09-181-1/+1
|
>; res = win_property(w, wmatom[WMProtocols], XA_ATOM, 20L, &protocols); if(res <= 0) { return protos; } for(i = 0; i < res; i++) { if(protocols[i] == wmatom[WMDelete]) protos |= WM_PROTOCOL_DELWIN; } free((char *) protocols); return protos; } void sendevent(Window w, Atom a, long value) { XEvent e; e.type = ClientMessage; e.xclient.window = w; e.xclient.message_type = a; e.xclient.format = 32; e.xclient.data.l[0] = value; e.xclient.data.l[1] = CurrentTime; XSendEvent(dpy, w, False, NoEventMask, &e); XSync(dpy, False); } void quit(Arg *arg) { running = False; } /* * There's no way to check accesses to destroyed windows, thus those cases are * ignored (especially on UnmapNotify's). Other types of errors call Xlibs * default error handler, which calls exit(). */ int xerror(Display *dpy, XErrorEvent *ee) { if(ee->error_code == BadWindow || (ee->request_code == X_SetInputFocus && ee->error_code == BadMatch) || (ee->request_code == X_PolyText8 && ee->error_code == BadDrawable) || (ee->request_code == X_PolyFillRectangle && ee->error_code == BadDrawable) || (ee->request_code == X_PolySegment && ee->error_code == BadDrawable) || (ee->request_code == X_ConfigureWindow && ee->error_code == BadMatch) || (ee->request_code == X_GrabKey && ee->error_code == BadAccess)) return 0; fprintf(stderr, "dwm: fatal error: request code=%d, error code=%d\n", ee->request_code, ee->error_code); return xerrorxlib(dpy, ee); /* may call exit() */ } int main(int argc, char *argv[]) { int i, n; fd_set rd; XSetWindowAttributes wa; unsigned int mask; Bool readstdin = True; Window w; XEvent ev; for(i = 1; (i < argc) && (argv[i][0] == '-'); i++) { switch (argv[i][1]) { default: eprint("usage: dwm [-v]\n"); break; case 'v': fputs("dwm-"VERSION", (C)opyright MMVI Anselm R. Garbe\n", stdout); exit(EXIT_SUCCESS); break; } } dpy = XOpenDisplay(0); if(!dpy) eprint("dwm: cannot connect X server\n"); screen = DefaultScreen(dpy); root = RootWindow(dpy, screen); /* check if another WM is already running */ otherwm = False; XSetErrorHandler(xerrorstart); /* this causes an error if some other WM is running */ XSelectInput(dpy, root, SubstructureRedirectMask); XSync(dpy, False); if(otherwm) eprint("dwm: another window manager is already running\n"); XSetErrorHandler(NULL); xerrorxlib = XSetErrorHandler(xerror); /* init atoms */ wmatom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False); wmatom[WMDelete] = XInternAtom(dpy, "WM_DELETE_WINDOW", False); netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False); netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False); XChangeProperty(dpy, root, netatom[NetSupported], XA_ATOM, 32, PropModeReplace, (unsigned char *) netatom, NetLast); /* init cursors */ cursor[CurNormal] = XCreateFontCursor(dpy, XC_left_ptr); cursor[CurResize] = XCreateFontCursor(dpy, XC_sizing); cursor[CurMove] = XCreateFontCursor(dpy, XC_fleur); grabkeys(); /* style */ dc.bg = getcolor(BGCOLOR); dc.fg = getcolor(FGCOLOR); dc.border = getcolor(BORDERCOLOR); setfont(FONT); sx = sy = 0; sw = DisplayWidth(dpy, screen); sh = DisplayHeight(dpy, screen); mw = (sw * MASTERW) / 100; wa.override_redirect = 1; wa.background_pixmap = ParentRelative; wa.event_mask = ButtonPressMask | ExposureMask; bx = by = 0; bw = sw; dc.h = bh = dc.font.height + 4; barwin = XCreateWindow(dpy, root, bx, by, bw, bh, 0, DefaultDepth(dpy, screen), CopyFromParent, DefaultVisual(dpy, screen), CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa); XDefineCursor(dpy, barwin, cursor[CurNormal]); XMapRaised(dpy, barwin); dc.drawable = XCreatePixmap(dpy, root, sw, bh, DefaultDepth(dpy, screen)); dc.gc = XCreateGC(dpy, root, 0, 0); drawstatus(); issel = XQueryPointer(dpy, root, &w, &w, &i, &i, &i, &i, &mask); wa.event_mask = SubstructureRedirectMask | EnterWindowMask \ | LeaveWindowMask; wa.cursor = cursor[CurNormal]; XChangeWindowAttributes(dpy, root, CWEventMask | CWCursor, &wa); strcpy(stext, "dwm-"VERSION); scan(); /* main event loop, reads status text from stdin as well */ Mainloop: while(running) { FD_ZERO(&rd); if(readstdin) FD_SET(STDIN_FILENO, &rd); FD_SET(ConnectionNumber(dpy), &rd); i = select(ConnectionNumber(dpy) + 1, &rd, 0, 0, 0); if(i == -1 && errno == EINTR) continue; if(i < 0) eprint("select failed\n"); else if(i > 0) { if(FD_ISSET(ConnectionNumber(dpy), &rd)) { while(XPending(dpy)) { XNextEvent(dpy, &ev); if(handler[ev.type]) (handler[ev.type])(&ev); /* call handler */ } } if(readstdin && FD_ISSET(STDIN_FILENO, &rd)) { i = n = 0; for(;;) { if((i = getchar()) == EOF) { /* broken pipe/end of producer */ readstdin = False; strcpy(stext, "broken pipe"); goto Mainloop; } if(i == '\n' || n >= sizeof(stext) - 1) break; stext[n++] = i; } stext[n] = 0; drawstatus(); } } } cleanup(); XCloseDisplay(dpy); return 0; }