This file contains hidden or 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
diff --git a/lib-clay/parsing/combinators/generic/generic.clay b/lib-clay/parsing/combinators/generic/generic.clay | |
index 24cac60..84a7c6d 100644 | |
--- a/lib-clay/parsing/combinators/generic/generic.clay | |
+++ b/lib-clay/parsing/combinators/generic/generic.clay | |
@@ -414,6 +414,6 @@ optSeparatedListStrict(#TokenInput, forward _separator:Separator, forward _eleme | |
alias T = ParseResult(TokenInput, Element); | |
return modify( | |
x => maybe(move(x), y => move(y), () => Vector[T]()), | |
- optional(separatedListStrict(_separator, _element)), | |
+ optional(TokenInput, separatedListStrict(TokenInput, _separator, _element)), |
This file contains hidden or 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
// "library" function to declare a record | |
[Base] | |
recordExtend(static Base, ..fields) = ..RecordFields(Base), ..fields; | |
// "library" function to declare hierarchy | |
// should be overloaded for each subtype, type pair | |
[A, B] | |
Extends?(static A, static B) = false; |
This file contains hidden or 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
# tested in zsh | |
# Don't try this at home. | |
command_not_found_handler() { | |
replaced=false | |
set -A args "$@" | |
# aliases like gcc-O2='gcc -O2' |
This file contains hidden or 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
############################### | |
overload GenericOSError?(#GenericOSError) = true; | |
[E, I, S when GenericOSError?(E) and Integer?(I) and StringLiteral?(S)] | |
-----------------------------^ | |
overload E(code:I, #S) --> returned:E { | |
returned.code = Int(code); | |
############################### | |
/Users/yozh/devel/left/clay/lib-clay/os/errors/errors.clay(13,29): error: unholy recursion detected | |
This file contains hidden or 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 printer.*; | |
private external backtrace(array:Pointer[RawPointer], size:Int) : Int; | |
record Backtrace ( | |
callstack: Array[RawPointer, 128], | |
); | |
showBacktraceMine() { | |
var bt = Backtrace(); |
This file contains hidden or 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 <stdio.h> | |
#include <unistd.h> | |
struct large_struct { | |
void* a[1024]; | |
}; | |
static void foo() { | |
struct large_struct r; | |
// call any function that is guaranteed to be not inlined |
This file contains hidden or 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 printer.*; | |
import unix; | |
record LargeRecord ( | |
a: Array[RawPointer, 1024], | |
); | |
foo() { | |
var a = LargeRecord(); | |
// call any function that is guaranteed to be not inlined |
This file contains hidden or 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
function! ResCur() | |
if line("'\"") <= line("$") | |
normal! g`" | |
return 1 | |
endif | |
endfunction | |
augroup resCur | |
autocmd! | |
autocmd BufWinEnter * call ResCur() |
This file contains hidden or 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
" from http://vim.wikia.com/wiki/Highlight_unwanted_spaces | |
highlight ExtraWhitespace ctermbg=lightgray guibg=lightgray | |
autocmd ColorScheme * highlight ExtraWhitespace ctermbg=lightgray guibg=lightgray | |
match ExtraWhitespace /\s\+$/ | |
autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/ | |
autocmd InsertLeave * match ExtraWhitespace /\s\+$/ |
This file contains hidden or 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 <execinfo.h> | |
#include <sys/time.h> | |
#include <stdio.h> | |
void foo(int i) { | |
if (i == 0) { | |
void* array[128]; | |
backtrace(array, 128); | |
} else { | |
foo(i - 1); |