[macruby-changes] [2298] MacRuby/trunk/ext/libyaml

source_changes at macosforge.org source_changes at macosforge.org
Wed Aug 12 15:49:34 PDT 2009


Revision: 2298
          http://trac.macosforge.org/projects/ruby/changeset/2298
Author:   pthomson at apple.com
Date:     2009-08-12 15:49:34 -0700 (Wed, 12 Aug 2009)
Log Message:
-----------
libyaml parser now doesn't recognize an ^M on its own as the end of a line, which fixes some parsing errors.

Modified Paths:
--------------
    MacRuby/trunk/ext/libyaml/rubyext.c
    MacRuby/trunk/ext/libyaml/scanner.c

Modified: MacRuby/trunk/ext/libyaml/rubyext.c
===================================================================
--- MacRuby/trunk/ext/libyaml/rubyext.c	2009-08-12 22:07:45 UTC (rev 2297)
+++ MacRuby/trunk/ext/libyaml/rubyext.c	2009-08-12 22:49:34 UTC (rev 2298)
@@ -391,6 +391,11 @@
 		node = handle_scalar(parser);
 		break;
 		
+		case YAML_ALIAS_EVENT:
+        rb_warn("ignoring alias");
+        node = Qnil;
+        break;
+		
 		default:
 		rb_raise(rb_eArgError, "Invalid event %d at top level", (int)parser->event.type);
 	}

Modified: MacRuby/trunk/ext/libyaml/scanner.c
===================================================================
--- MacRuby/trunk/ext/libyaml/scanner.c	2009-08-12 22:07:45 UTC (rev 2297)
+++ MacRuby/trunk/ext/libyaml/scanner.c	2009-08-12 22:49:34 UTC (rev 2298)
@@ -537,8 +537,7 @@
       parser->mark.column = 0,                                                  \
       parser->mark.line ++,                                                     \
       parser->unread -= 2) :                                                    \
-     (CHECK_AT(parser->buffer,'\r',0)                                           \
-      || CHECK_AT(parser->buffer,'\n',0)) ?         /* CR|LF -> LF */           \
+     (CHECK_AT(parser->buffer,'\n',0)) ? /* MacRuby addition: CRs are ignored */\
      (*((string).pointer++) = (yaml_char_t) '\n',                               \
       parser->buffer.pointer ++,                                                \
       parser->mark.index ++,                                                    \
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090812/e14f1f08/attachment.html>


More information about the macruby-changes mailing list