openbibleinfo / Bible-Passage-Reference-Parser

Coffeescript to identify and understand Bible references like "John 3:16."
223 stars 65 forks source link

Unable to compile, issues with frak #30

Closed alerque closed 7 years ago

alerque commented 8 years ago

After a long time being buried or distracted, I'm back to needing a version of this with good Turkish support. The bit I hacked in (#17) for a previous project has some bugs that need fixing and I need it for another project now too. Unfortunately I'm unable to compile new builds at all. Strangely I can't even build from the current master branch or my own sources that used to work.

I suspect the issue is different versions of node or some other system tool, but I haven't been able to pin it down yet and am looking for ideas.

It doesn't matter at all what language I try to build, all of them give the same error:

❯❯❯ perl 01.add_lang.pl es
Gen 84

/home/caleb/projects/viachristus/incil.info/vendor/openbibleinfo/Bible-Passage-Reference-Parser/bin/js/frak.min.js:1
(function (exports, require, module, __filename, __dirname) { function e(a){throw a;}var h=void 0,k=!0,l=null,n=!1;function aa(){return function(a){return a}}function p(a){return function(){return this[a]}}function q(a){return function(){return a}}var r,ba=this;function ca(a,b){var c=a.split("."),d=ba;!(c[0]in d)&&d.execScript&&d.execScript("var "+c[0]);for(var f;c.length&&(f=c.shift());)!c.length&&b!==h?d[f]=b:d=d[f]?d[f]:d[f]={}}
                                                                            ^
Invalid match arg: /\(\?:?(\[[^\]]+\])\)(\?)?/

I've tried dropping in an updated version of frak, but that didn't change anything. I'm running node v6.3.1 and perl v5.24.0.

openbibleinfo commented 8 years ago

It looks like there's a frak incompatibility with recent versions of node. On line 216 of frak.min.js, try changing:

b.hasOwnProperty("source")

to:

b.source

That made it work for me on 6.3.0.

openbibleinfo commented 7 years ago

Switched to regexgen from frak in 2.0.1 to fix this problem better.