This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
discard newDialog( | |
newTitleFrame(tr"Main Menu", | |
newVLayout(@[ | |
newButton(tr"New Game", on_click=new_game, is_expandable=EXPAND_WIDTH), | |
newButton(tr"Quick Game", on_click=quick_new_game, is_expandable=EXPAND_WIDTH), | |
newButton(tr"Quick Load", on_click=dummy, is_expandable=EXPAND_WIDTH), | |
newButton(tr"Editor", on_click=quick_load_game, is_expandable=EXPAND_WIDTH), | |
newButton(tr"Exit", on_click=game_exit, is_expandable=EXPAND_WIDTH), | |
]), | |
), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nim -r c --cc:gcc tests/stdlib/tbitops2.nim && \ | |
nim -r c --cc:clang tests/stdlib/tbitops2.nim && \ | |
nim -r c -d:release --cc:clang tests/stdlib/tbitops2.nim && \ | |
nim -r c -d:release --cc:gcc tests/stdlib/tbitops2.nim && \ | |
nim -r c --cc:gcc tests/stdlib/tbitops.nim && \ | |
nim -r c --cc:clang tests/stdlib/tbitops.nim && \ | |
nim -r c -d:release --cc:clang tests/stdlib/tbitops.nim && \ | |
nim -r c -d:release --cc:gcc tests/stdlib/tbitops.nim && \ | |
nim -r c --cc:gcc --cpu:i386 --passc: -m32 --passL: -m32 tests/stdlib/tbitops2.nim && \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
KIND nkIntLit | |
Traceback (most recent call last) | |
nim.nim(121) nim | |
nim.nim(77) handleCmdLine | |
main.nim(163) mainCommand | |
main.nim(74) commandCompileToC | |
modules.nim(240) compileProject | |
modules.nim(180) compileModule | |
passes.nim(213) processModule | |
passes.nim(135) processTopLevelStmt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import macros | |
proc ctor_impl*(allocator: NimNode, prc: NimNode): auto {.compiletime.} = | |
# if prc[3][1][1].kind != nnkVarTy: | |
# error("Constructor must have var non-ref type as first parameter") | |
if prc[3][0].kind != nnkEmpty: | |
error("Constructor must not have return type") | |
if not ($prc[0] == "init" or $prc[0] == "init*"): | |
error("Constructor name must be `init`") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
proc parse_hex*(num: var int; ch: char) = | |
case ch | |
of '0'..'9': num = (num shl 4) or (ch.int - '0'.int) | |
of 'a'..'f': num = (num shl 4) or (ch.int - 'a'.int) + 10 | |
of 'A'..'F': num = (num shl 4) or (ch.int - 'A'.int) + 10 | |
else: raise newException(ValueError, "invalid unicode hexcode") | |
template ones(n: expr): expr = ((1 shl n)-1) | |
proc runeLenAt(s: string, i: Natural): int = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <string.h> | |
typedef struct TFrame TFrame; | |
struct TFrame { | |
TFrame* prev; | |
char *procname; | |
int64_t line; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
typedef struct TFrame TFrame; | |
struct TFrame { | |
TFrame* prev; | |
char *procname; | |
int64_t line; | |
char *filename; |