{"issue":{"user":{"login":"aselder","id":11577,"url":"https://api.github.com/users/aselder","avatar_url":"https://secure.gravatar.com/avatar/d35d964695abd1bac108370eaf001af3?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"d35d964695abd1bac108370eaf001af3"},"title":"Psych has some issue with some inline objects.","milestone":null,"created_at":"2011-08-17T21:50:14Z","updated_at":"2011-12-15T23:54:26Z","labels":[],"state":"closed","id":1426671,"html_url":"https://github.com/tenderlove/psych/issues/24","closed_at":"2011-12-15T23:54:26Z","pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"body":"This was discovered while I was playing around with roodi:\r\n\r\nThis YAML fragment parses fine under both Syck and Psych:\r\n\r\n    ClassNameCheck:                  \r\n      pattern: !ruby/regexp /^[A-Z][a-zA-Z0-9]*$/\r\n\r\nHowever, if you turn this into a single line object\r\n\r\n    ClassNameCheck:                  { pattern: !ruby/regexp /^[A-Z][a-zA-Z0-9]*$/ }\r\n\r\nPsych blows up on it, although Syck handles it fine.\r\n\r\n    Psych::SyntaxError: couldn't parse YAML at line 4 column 60\r\n\tfrom /Users/andrew/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych.rb:148:in `parse'\r\n\tfrom /Users/andrew/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych.rb:148:in `parse_stream'\r\n\tfrom /Users/andrew/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych.rb:119:in `parse'\r\n\tfrom /Users/andrew/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych.rb:106:in `load'\r\n\tfrom /Users/andrew/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych.rb:205:in `load_file'\r\n\tfrom (irb):8\r\n\tfrom /Users/andrew/.rvm/rubies/ruby-1.9.2-p290/bin/irb:16:in `<main>'","number":24,"url":"https://api.github.com/repos/tenderlove/psych/issues/24","comments":1,"assignee":null},"comment":{"user":{"login":"tenderlove","id":3124,"url":"https://api.github.com/users/tenderlove","avatar_url":"https://secure.gravatar.com/avatar/f29327647a9cff5c69618bae420792ea?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"f29327647a9cff5c69618bae420792ea"},"created_at":"2011-12-15T23:54:26Z","updated_at":"2011-12-15T23:54:26Z","id":3171214,"body":"The problem is that when you put the regular expression inside a flow map node, the `[]` become ambiguous.  In that context they could possibly be parsed as inline \"flow arrays\".\r\n\r\nHopefully [this page](http://yaml-online-parser.appspot.com/?yaml=ClassNameCheck%3A++++++++++++++++++%7B+pattern%3A+!ruby%2Fregexp+%2F%5E%5BA-Z%5D%5Ba-zA-Z0-9%5D*%24%2F+%7D&type=json) will explain.","url":"https://api.github.com/repos/tenderlove/psych/issues/comments/3171214"},"action":"created"}