[macruby-changes] [2967] MacRuby/trunk/parse.y
source_changes at macosforge.org
source_changes at macosforge.org
Fri Nov 6 13:54:15 PST 2009
Revision: 2967
http://trac.macosforge.org/projects/ruby/changeset/2967
Author: lsansonetti at apple.com
Date: 2009-11-06 13:54:10 -0800 (Fri, 06 Nov 2009)
Log Message:
-----------
clean up the magic comment parsing code, which should hopefully fix the build
Modified Paths:
--------------
MacRuby/trunk/parse.y
Modified: MacRuby/trunk/parse.y
===================================================================
--- MacRuby/trunk/parse.y 2009-11-06 07:02:15 UTC (rev 2966)
+++ MacRuby/trunk/parse.y 2009-11-06 21:54:10 UTC (rev 2967)
@@ -6227,9 +6227,6 @@
{
VALUE name = 0, val = 0;
const char *beg, *end, *vbeg, *vend;
-#define str_copy(_s, _p, _n) ((_s) \
- ? CFStringPad((CFMutableStringRef)_s, CFMakeCollectable(CFStringCreateWithCString(NULL, _p, kCFStringEncodingUTF8)), _n, 0) \
- : ((_s) = STR_NEW((_p), (_n))))
if (len <= 7) return Qfalse;
if (!(beg = magic_comment_marker(str, len))) return Qfalse;
@@ -6287,7 +6284,7 @@
while (len > 0 && (*str == ';' || ISSPACE(*str))) --len, str++;
n = end - beg;
- str_copy(name, beg, n);
+ name = STR_NEW(beg, n);
#ifndef RIPPER
do {
if (STRNCASECMP(p->name, RSTRING_PTR(name), n) == 0) {
@@ -6295,7 +6292,7 @@
if (p->length) {
n = (*p->length)(parser, vbeg, n);
}
- str_copy(val, vbeg, n);
+ val = STR_NEW(vbeg, n);
(*p->func)(parser, RSTRING_PTR(name), RSTRING_PTR(val));
break;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20091106/28e52447/attachment.html>
More information about the macruby-changes
mailing list