Closed willhbr closed 2 years ago
That is an interesting bug, but it might explain some issues I had with regular expressions on the mruby side at one point.
I will look into this problem, thank you for reporting it!
Temporary workaround:
I added a no-regex branch to Anyolite, which excludes the problematic Regex gem from the mruby configuration (passing a custom mruby configuration file with the respective line removed does the same).
Your code snippet works perfectly fine with that branch. However, you can obviously only use Regexes in Crystal then, not in mruby.
The gem is relatively unmaintained, so it might be best practice to remove it from Anyolite anyway (at least until I find a better replacement). I will keep this issue open until there's a way to have Regexes in both languages.
conf.gem :mgem => 'regexp-pcre'
from file lib/anyolite/utility/mruby_build_config.rb
rake build_shard
Should also works.
Perfect, thanks! I've checked and this works on my project.
I've now also removed the regex gem from the main branch, since it doesn't work at all with Crystal 1.5.1.
I will close this issue for now, but I will try to find a replacement for the gem.
Update: mruby has Regex support again.
I really don't know how I didn't just wrap the Crystal Regex
class before... 😄
If you
require "anyolite"
and create anRbInterpreter
, Crystal regexes stop working. I assume this is because mruby links in a version that has been compiled without UTF-8 support, and Crystal strings are UTF-8.This example program:
Fails with:
Is it possible to link in PCRE with UTF support?
Thanks :)