Skip to content

Instantly share code, notes, and snippets.

@mmasaki
Created June 27, 2012 16:18
Show Gist options
  • Save mmasaki/3005159 to your computer and use it in GitHub Desktop.
Save mmasaki/3005159 to your computer and use it in GitHub Desktop.
Syckにカンマの後のs-separate(n,c)(YAML1.0ではs-s-required(n))が無いFlow Sequencesを許してもらう
~% ruby -v -r syck -e 'p Syck.load("[0,1]")'
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
[0, 1]
% ruby -v -r syck -e 'p Syck.load("[0,1]")'
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
[1]
diff --git a/lib/token.re b/lib/token.re
index c9fdf46..937c76c 100644
--- a/lib/token.re
+++ b/lib/token.re
@@ -306,7 +306,7 @@ LF = ( "\n" | "\r\n" ) ;
SPC = " " ;
TAB = "\t" ;
SPCTAB = ( SPC | TAB ) ;
-ENDSPC = ( SPC+ | LF ) ;
+ENDSPC = ( SPC* | LF ) ;
YINDENT = LF TAB* ( SPC | LF )* ;
NULL = [\000] ;
ANY = [\001-\377] ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment