Skip to content

Instantly share code, notes, and snippets.

Avatar

Timothee Cour timotheecour

View GitHub Profile
View gist:192fcbb8fda23b2012f8f420d88bf893
# Sub-Syntax selectors
- comment: C
name: source.c.embedded.nim
patterns:
- begin: \{\.(emit:)
end: \.\}
captures:
'1': {name: keyword.other.nim}
'2': {name: comment.syntax.nim}
endCaptures:
View nimhelp.rst

Nim Compiler Version 1.5.1 [MacOSX: amd64] Compiled at 2021-04-02 Copyright (c) 2006-2021 by Andreas Rumpf

nim command [options] [projectfile] [arguments]
Command:
compile, c
compile project with default code generator (C)
View gist:fac4d205e3f0710513da496b7da7143c
prompt:lhmbp $nim_prs_D br:pr_fix_fileInfos_debugging dur:0.000 $ d_nim_build_simple_local -o:$nimb.d3 --stacktrace
/Users/timothee/.choosenim/toolchains//nim-1.4.4/bin/nim c -o:bin/nim_temp1 -d:release --lib:lib -d:nimUseLinenoise -o:bin/nim.pr_fix_fileInfos_debugging -o:bin/nim.pr_fix_fileInfos_debugging.d3 --stacktrace compiler/nim.nim \;\ redirect:\ /tmp/D20190703T231248.log
prompt:lhmbp $nim_prs_D br:pr_fix_fileInfos_debugging dur:29.072 $ $nimb c compiler/nim
/Users/timothee/git_clone/nim/Nim_prs/lib/system/fatal.nim(53) sysFatal
Error: unhandled exception: index out of bounds, the container is empty [IndexDefect]
prompt:lhmbp $nim_prs_D br:pr_fix_fileInfos_debugging dur:0.054 ERROR:1 $ $nimb.d3 c compiler/nim
/Users/timothee/git_clone/nim/Nim_prs/compiler/nim.nim(125) nim
/Users/timothee/git_clone/nim/Nim_prs/compiler/nim.nim(82) handleCmdLine
/Users/timothee/git_clone/nim/Nim_prs/compiler/cmdlinehelper.nim(64) loadConfigsAndProcessCmdLine
/Users/timothee/git_clone/nim/Nim_prs/compiler/nimconf.nim(260)
View gist:ade3904ff0c98a8652623dd94031dd25
code listing:
157 LdNullReg r1, 2 # /Users/timothee/git_clone/nim/timn/tests/nim/all/t12092.nim(360, 9)
158 LdImmInt r2, 0 # /Users/timothee/git_clone/nim/timn/tests/nim/all/t12092.nim(360, 14)
L159:
159 LdImmInt r3, 1000 # /Users/timothee/git_clone/nim/timn/tests/nim/all/t12092.nim(360, 18)
160 LtInt r4, r2, r3 # /Users/timothee/git_clone/nim/Nim_prs/lib/system/iterators_1.nim(120, 11)
161 FJmp r4, L205 # /Users/timothee/git_clone/nim/Nim_prs/lib/system/iterators_1.nim(120, 3)
162 AsgnInt r1, r2, r0 # /Users/timothee/git_clone/nim/timn/tests/nim/all/t12092.nim(360, 9)
163 LdNull r5, 4 # /Users/timothee/git_clone/nim/timn/tests/nim/all/t12092.nim(361, 12)
164 LdNull r6, 4 # /Users/timothee/git_clone/nim/timn/tests/nim/all/t12092.nim(361, 17)
View gist:f1e3a97dff99a02046d23e2bb13af133
(lldb) run
[GCASSERT] incRef: interiorPtrTraceback (most recent call last)
/Users/timothee/git_clone/nim/Nim_prs/compiler/nim.nim(125) nim
/Users/timothee/git_clone/nim/Nim_prs/compiler/nim.nim(84) handleCmdLine
/Users/timothee/git_clone/nim/Nim_prs/compiler/main.nim(242) mainCommand
/Users/timothee/git_clone/nim/Nim_prs/compiler/main.nim(213) compileToBackend
/Users/timothee/git_clone/nim/Nim_prs/compiler/main.nim(90) commandCompileToC
/Users/timothee/git_clone/nim/Nim_prs/compiler/modules.nim(178) compileProject
/Users/timothee/git_clone/nim/Nim_prs/compiler/modules.nim(97) compileModule
/Users/timothee/git_clone/nim/Nim_prs/compiler/passes.nim(180) processModule
View gist:f8ce7fc19199df35722c15a916a96ab8
import std/[strutils, sequtils, strformat, sugar,
macros, options, tables, json]
import fusion/matching
{.experimental: "caseStmtMacros".}
{.push hint[XDeclaredButNotUsed]: off.}
{.push hint[ConvFromXtoItselfNotNeeded]: off.}
{.push hint[CondTrue]: off.}
import unittest
View gist:b38e814a7e53e84be42a275d634b049d
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x10d6336c0)
frame #0: 0x0000000100021842 nim.pr_iterator_array_lent.d3`collectZCT__EN6T32AMm3va9bsrdxtF0cg + 66
nim.pr_iterator_array_lent.d3`collectZCT__EN6T32AMm3va9bsrdxtF0cg:
-> 0x100021842 <+66>: andq $-0x5, (%rbx)
0x100021846 <+70>: movq 0x18(%r15), %rcx
0x10002184a <+74>: movq -0x8(%rax,%rcx,8), %rdx
0x10002184f <+79>: decq %rcx
Target 0: (nim.pr_iterator_array_lent.d3) stopped.
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x10d6336c0)
View gist:bedd47e519d6c07a9d449e619ba1b775
(lldb) process attach --pid 9466
Process 9466 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
frame #0: 0x00007fff6a66955e libsystem_kernel.dylib`__ulock_wait + 10
libsystem_kernel.dylib`__ulock_wait:
-> 0x7fff6a66955e <+10>: jae 0x7fff6a669568 ; <+20>
0x7fff6a669560 <+12>: movq %rax, %rdi
0x7fff6a669563 <+15>: jmp 0x7fff6a668629 ; cerror_nocancel
0x7fff6a669568 <+20>: retq
Target 0: (t12015) stopped.
View gist:23ba7f8cafac1c5657463d239db2f577
(lldb) process attach --pid 3358
Process 3358 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
frame #0: 0x00007fff6a66955e libsystem_kernel.dylib`__ulock_wait + 10
libsystem_kernel.dylib`__ulock_wait:
-> 0x7fff6a66955e <+10>: jae 0x7fff6a669568 ; <+20>
0x7fff6a669560 <+12>: movq %rax, %rdi
0x7fff6a669563 <+15>: jmp 0x7fff6a668629 ; cerror_nocancel
0x7fff6a669568 <+20>: retq
Target 0: (t12015) stopped.
View test.nim
when defined case1:
## a11
## ===
##
## a12
## ---
##
## a13
## ~~~
##