In 'The Ruby Way' from Hal Fulton you find the following:

def oniguruma?
  return true if RUBY_VERSION >= "1.9.0"
  if defined?(Regexp::ENGINE) # Is ENGINE defined?
    if Regexp::ENGINE.include?('Oniguruma')
      return true # Some version of Oniguruma
    else
      return false # Pre-Oniguruma engine
    end
  end
  eval("/(?<!a)b/") # Newer syntax
  return true # It worked: New engine.
  rescue SyntaxError # It failed: We're using the
    return false # old engine.
end

On 5/5/07, Spongy <[EMAIL PROTECTED]> wrote:
>
> I'll take a look and see if there is a way to detect the regex engine.
> Just looking at the regex though I'm not really sure which part it is
> breaking on.
>
> On May 4, 7:32 pm, "Nathan Weizenbaum" <[EMAIL PROTECTED]> wrote:
> > Haml probably breaks in several different ways with 1.9. We'll eventually go
> > through and rewrite the regexen for Oniguruma (which will in turn fix a few
> > parsing bugs), but for now, I'm just going to declare it incompatible.
> >
> > Is there a way to detect which Regex engine is available? If so, we'd gladly
> > take a patch to run an engine detect and use compatible regexen.
> >
> > - Nathan
> >
> > On 5/4/07, Spongy <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > > This seems to break if you have compiled Ruby with the Oniguruma
> > > regular expression engine which I believe is also the regex engine in
> > > Ruby 1.9.
> >
> > > I get the following error
> > > SyntaxError: <path>/vendor/plugins/haml/lib/sass/engine.rb:43: target
> > > of repeat operator is invalid: /:([^\s=:]+)\s*(=?)(?:\s|$)+(.*)/
> >
> > > On May 3, 10:08 am, Nathan Weizenbaum <[EMAIL PROTECTED]> wrote:
> > > > Hello, folks,
> >
> > > > I just made the 500th Subversion commit! Whoo, large figures significant
> > > > only in base 10! Anyhoo, both commits 499 and 500 have some cool new
> > > > features. The first is a new attribute syntax for Sass, implemented by
> > > > Jonah Fox (aka weepy):
> >
> > > >   #main
> > > >     color: #f00
> > > >     background:
> > > >       image: url(/images/hideous_animation.gif)
> > > >       repeat: repeat-x
> >
> > > > This will be available alongside the old familiar ":foo bar" syntax.
> >
> > > > The second feature is by Robin Ward, and it's the ability to nest Sass
> > > > files in the public/stylesheets/sass folder. So, for instance,
> > > > public/stylesheets/sass/how_awesome/super_awesome.sass will create
> > > > public/stylesheets/how_awesome/super_awesome.css. This promises to be
> > > > very useful for larger projects
> >
> > > > Enjoy! And be sure to thank our wonderful contributors!
> > > > - Nathan
>
>
> >
>


-- 
--Merg

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Haml" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to