Skip to content

Instantly share code, notes, and snippets.

ArrayDecl: class extends Node {
/*
def __init__(self, type, dim, coord=None):
self.type = type
self.dim = dim
self.coord = coord
def children(self):
nodelist = []
if self.type is not None: nodelist.append(("type", self.type))
class OhaiClass(Node):
def ohai():
print "ohai"
becomes
OhaiClass: extends Node {
/*
def ohai():
print "ohai"
void abstract__A_myFunc(abstract__A* this, lang_Numbers__Int ) {
((abstract__AClass *)((lang_types__Object *)this)->class)->myFunc((abstract__A*)this, );
}
ERROR:
rock_tmp/./abstract.c:26:62: error: parameter name omitted
void abstract__A_myFunc(abstract__A* this, lang_Numbers__Int ) {
^
rock_tmp/./abstract.c:27:91: error: expected expression
yannic@bildersturm ~/dev/devRock (git)-[master] % grep -inIEr --color=ALWAYS "getBaseClass" source/
source/rock/backend/cnaughty/ClassDeclWriter.ooc:205: baseClass := cDecl getBaseClass(fDecl)
source/rock/middle/ClassDecl.ooc:131: getBaseClass: func ~noInterfaces (fDecl: FunctionDecl, comeBack: Bool@) -> ClassDecl {
source/rock/middle/ClassDecl.ooc:132: getBaseClass(fDecl, false, comeBack)
source/rock/middle/ClassDecl.ooc:135: getBaseClass: func (fDecl: FunctionDecl, withInterfaces, comeBack: Bool@) -> ClassDecl {
source/rock/middle/ClassDecl.ooc:141: base := sRef getBaseClass(fDecl, comeBack)
source/rock/middle/ClassDecl.ooc:160: base := iRef getBaseClass(fDecl, comeBack&)
source/rock/middle/FunctionDecl.ooc:467: base := meat getBaseClass(this, true, comeBack&)
> stoopidDouble = "\x40\x00\x00\x00\x00\x00\x00\x00"
> struct.unpack(">d", stoopidDouble)
(2.0.)
AVMediaType: enum from Int {
AVMEDIA_TYPE_UNKNOWN = -1
AVMEDIA_TYPE_VIDEO
AVMEDIA_TYPE_AUDIO
AVMEDIA_TYPE_DATA
AVMEDIA_TYPE_SUBTITLE
AVMEDIA_TYPE_ATTACHMENT
AVMEDIA_TYPE_NB
}
@showstopper
showstopper / gist:1395456
Created November 26, 2011 10:56
flv_writer_header structs (doxy)
AVIOContext - http://cekirdek.pardus.org.tr/~ismail/ffmpeg-docs/structAVIOContext.html
FLVContext - http://ffmpeg.org/doxygen/trunk/structFLVContext.html
AVCodecContext - http://cekirdek.pardus.org.tr/~ismail/ffmpeg-docs/structAVCodecContext.html
AVDictionary - http://ffmpeg.org/doxygen/trunk/structAVDictionaryEntry.html (dead simple key-val combo)
AVFormatContext - http://cekirdek.pardus.org.tr/~ismail/ffmpeg-docs/structAVFormatContext.html
fs = require "fs"
buffer = require "buffer"
binary = require "./binarystream"
FILENAME = "pic.png"
HEADER = new buffer.Buffer([0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A])
read = (fName) =>
fs.readFileSync(fName)
import myclasses
main: func { B new() }
A: class extends Exception {
init: func (=message) {
init()
}
init: func ~noOrigin {
x := getOSError()
if ((message != null) && (!message empty?())) {
message = message append(':') append(x)
} else message = x