Giter Site home page Giter Site logo

Comments (4)

k-takata avatar k-takata commented on May 26, 2024

Ruby uses customized version of Onigmo. Currently, the customized version is stored in the branch tmp/ruby-2.0.x.
(You can see the differences between the branches master and tmp/ruby-2.0.x here: master...tmp;ruby-2.0.x#files_bucket )

Warning functions are also customized for Ruby. Your patch is only needed for the branch tmp/ruby-2.0.x.
onig_verb_warn is still used in the master branch. So, it is not a good idea to remove onig_verb_warn and related codes. Isn't it enough to change inside the function set_quantifier?

from onigmo.

srawlins avatar srawlins commented on May 26, 2024

On your master branch, I only see the following uses:

$ git branch
* master
$ git  grep -n -C 1 "onig_verb_warn"
regparse.c-90-#ifdef DEFAULT_VERB_WARN_FUNCTION
regparse.c:91:static OnigWarnFunc onig_verb_warn = (OnigWarnFunc )DEFAULT_VERB_WARN_FUNCTION;
regparse.c-92-#else
regparse.c:93:static OnigWarnFunc onig_verb_warn = onig_null_warn;
regparse.c-94-#endif
--
regparse.c-102-{
regparse.c:103:  onig_verb_warn = f;
regparse.c-104-}
--
regparse.c-5217-        case RQ_DEL:
regparse.c:5218:          if (onig_verb_warn != onig_null_warn) {
regparse.c-5219-            onig_snprintf_with_pattern(buf, WARN_BUFSIZE, env->enc,
--
regparse.c-5221-                                 (UChar* )"redundant nested repeat operator");
regparse.c:5222:            (*onig_verb_warn)((char* )buf);
regparse.c-5223-          }
--
regparse.c-5227-        default:
regparse.c:5228:          if (onig_verb_warn != onig_null_warn) {
regparse.c-5229-            onig_snprintf_with_pattern(buf, WARN_BUFSIZE, env->enc,
--
regparse.c-5233-            ReduceQStr[ReduceTypeTable[targetq_num][nestq_num]]);
regparse.c:5234:            (*onig_verb_warn)((char* )buf);
regparse.c-5235-          }

So once onig_verb_warn is no longer used in lines 5222 and 5234, it is no longer used anywhere.

from onigmo.

k-takata avatar k-takata commented on May 26, 2024

onig_verb_warn is used for verbose warning function.
Removing them cause API incompatibility.

from onigmo.

srawlins avatar srawlins commented on May 26, 2024

Ah, I understand! Both onig_set_verb_warn_func and onig_verb_warn are part of the public API, so we should not delete them. Thanks for the analysis.

I just opened #32 that is a smaller fix, only changing those two references to instead use onig_syntax_warn.

from onigmo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.