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
function debug_refs() | |
local reftable = {} | |
local function trace_refs(o, src, src2, src3) | |
local typ = type(o) | |
if typ == 'number' or typ == 'boolean' or typ == 'string' or typ == 'thread' or typ == 'nil' then return end | |
if o == debug_refs or o == reftable or o == trace_refs then return end | |
if reftable[o] then return end | |
reftable[o] = true | |
if src3 then | |
src = string.format('%s%s%s', src, src2, tostring(src3)) |
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
local function get_args(fun) | |
local args = {} | |
local hook = debug.gethook() | |
local argHook = function( ... ) | |
local info = debug.getinfo(3) | |
if 'pcall' ~= info.name then return end | |
for i=1,100 do | |
local name, value = debug.getlocal(2, i) | |
if name == nil or name:match('%(') then |
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
package="lbc" | |
version="20180729-1" | |
source = { | |
url = "http://webserver2.tecgraf.puc-rio.br/~lhf/ftp/lua/ar/lbc-100.tar.gz", | |
md5 = "e5db9e3d0cc28099e0b3b6018939b43e", | |
dir = "lbc-100" | |
} | |
description = { | |
summary = "A simple arbitrary precision library", | |
detailed = [[ |
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
package = "lcomplex" | |
version="20180729-1" | |
source = { | |
url = "http://webserver2.tecgraf.puc-rio.br/~lhf/ftp/lua/ar/lcomplex-100.tar.gz", | |
dir = "lcomplex-100", | |
md5 = "ba3c9babf127cf1a313453bcabaf2a73" | |
} | |
description = { |
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 SDL headers | |
!!cdefine 'SDL_DISABLE_IMMINTRIN_H' | |
!!cinclude '<SDL2/SDL.h>' | |
!!linklib 'SDL2' | |
-- import SDL structures | |
local SDL_Event = @record { | |
type: uint32, | |
padding: array<byte, 56> | |
} |
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
/* This file was auto generated by Euluna. */ | |
/* Compile command: gcc -pipe -std=c99 -fno-strict-aliasing -rdynamic -lm -Wall -Wextra -Wno-incompatible-pointer-types -g -lSDL2 -o "euluna_cache/playground/snake" "euluna_cache/playground/snake.c" */ | |
/* Compile hash: 2waXGLampSxudc7zNvTWHfYvFPNb */ | |
#include <stddef.h> | |
#include <stdint.h> | |
#include <stdbool.h> | |
#include <stdarg.h> | |
#include <string.h> | |
#define EULUNA_NORETURN __attribute__((noreturn)) |
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
!!strict | |
-- optimize for performance | |
!!cflags '-O3 -ffast-math -march=native -fno-plt -flto -fopenmp -rdynamic -g' | |
!!ldflags '-flto' | |
-------------------------------------------------------------------------------- | |
-- SDL | |
-- import SDL headers |
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 <stdint.h> | |
#include <stdio.h> | |
struct Shape { | |
Shape(int64_t x, int64_t y): x(x), y(y) {} | |
virtual int64_t area() {return 0;} | |
int64_t x, y; | |
}; | |
struct Rectangle : public Shape { |
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
-------------------------------------------------------------------------------- | |
-- meta programming utilities for inheritance | |
##[[ | |
local function check_record_type(sym) | |
staticassert(sym and sym.type and sym.type:is_type() and sym.value:is_record(), | |
"symbol '%s' must be a type holding a record type", sym.name) | |
return sym.value | |
end |
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
local re = require 'relabel' | |
local file = require 'pl.file' | |
local stringx = require 'pl.stringx' | |
local grammar = [[ | |
body <- {| line+ |} | |
line <- (extern / anyline) | |
anyline <- linerest | |
linerest<- [^;]* ';' sp | |
sp <- %s* |