Skip to content

Commit

Permalink
It compiles, doesn't segfault, *and* runs to the point that it compla…
Browse files Browse the repository at this point in the history
…ins about the lack of Nagaqueen#setTokenPositionPointer. WIN.
  • Loading branch information
Nick Markwell committed Jun 24, 2012
1 parent 90d7ad3 commit 9dfb9ea
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions lib/ooc.rb
@@ -1,6 +1,13 @@
#!/usr/bin/env ruby

dir = File.expand_path(File.dirname(__FILE__))

require 'pp'
require File.join(File.expand_path(File.dirname(__FILE__)), 'nagaqueen')

class Nagaqueen
# Insert insanity here.
end

nq = Nagaqueen.new(File.join(dir, '..', 'test', 'test.ooc'))

6 changes: 3 additions & 3 deletions nagaqueen/ruby_nagaqueen.c
Expand Up @@ -38,14 +38,14 @@ int _nq_parse(VALUE self, char *path) {
VALUE rb_nq_init(VALUE self, VALUE filename) {
int ret;

ast = rb_cv_get(self, "@@ast");
ret = _nq_parse(self, STR2CSTR(filename));
ast = rb_iv_get(self, "@ast");
ret = _nq_parse(self, StringValuePtr(filename));

return (ret == 0 ? Qtrue : Qfalse);
}

void Init_nagaqueen() {
cNagaqueen = rb_define_class("Nagaqueen", rb_cObject);
rb_define_method(cNagaqueen, "initialize", rb_nq_init, 0);
rb_define_method(cNagaqueen, "initialize", rb_nq_init, 1);
}

0 comments on commit 9dfb9ea

Please sign in to comment.