Skip to content

Instantly share code, notes, and snippets.

View flyx's full-sized avatar

Felix Krause flyx

View GitHub Profile
@flyx
flyx / foo-bar.adb
Created January 28, 2012 17:00
This serves as example to show Ada syntax highlighting bugs in pygments
package Foo is
end Foo;
package Foo.Bar is
type Hurz is (Kol, Ra, Bi);
for Hurz use (Kol => 1, Ra => 2, Bi => 3);
end Foo.Bar;
@flyx
flyx / foo.adb
Created January 28, 2012 16:36
Yields "foo.adb:12:04: warning: types for unchecked conversion have different sizes"
with Ada.Unchecked_Conversion;
with Interfaces.C;
with Ada.Text_IO;
procedure Foo is
type Bar is (Kol, Ra, Bi);
for Bar use (Kol => 1, Ra => 2, Bi => 3);
for Bar'Size use Interfaces.C.int'Size;
subtype Cocktail_Bar is Bar range Kol .. Ra;
@flyx
flyx / Makefile
Last active September 17, 2015 08:26
making it work
# Makefile to make it work
it:
@echo > /dev/null
work:
@echo "aye!"
# support for Picard
so:
@echo "Warp 9 engaged."
.PHONY: it work so
@flyx
flyx / test.nim
Last active August 29, 2015 14:18
import macros
macro callFilter(filter: stmt, value: stmt): expr =
if value.kind == nnkStrLit:
newStmtList(
newNimNode(nnkConstSection).add(newNimNode(nnkConstDef).add(newIdentNode("filtered"), newEmptyNode(),
newCall(filter, value))),
newIdentNode("filtered"))
else:
newCall(filter, value)
class Foo {
std::move_iterator move_it;
int I;
public:
Foo(const int like_to, const std::move_iterator& move_it) :
I(like_to), move_it(move_it) {}
};