Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Syntax hightlighting : not-defined operator

2011-03-04
2013-05-20
  • Hello all,

    I'm running EPIC 0.5.46. Whenever I use the not-defined operator added in perl 5.10 (which is //), the syntax hightighter used by the editor parses it as bad regexp pattern and comments out all my code after the operator. That's a pretty bad behavior, to the point that I have to refrain from using this operator.

    Test case : everything after "//" is parsed as comment.

    $a = $b // "fubar";
    

    What is the parser used by EPIC? Is there a way to solve this problem?

    Thanks for your time.

     
  • Jan Ploski
    Jan Ploski
    2011-03-04

    The parser used by EPIC is a custom one based on ANTLR.

    I noticed that your test case doesn't cause a syntax highlighting problem in the current 'testing' (0.6.x) version, so the easiest solution might be to simply upgrade EPIC.

     
  • It looks like EPIC is using ANTLR 2.7.5. Last stable version is 2.7.7, released in 2006. So I guess I'm stuck here, unless I patch the source code of ANTLR2 myself - very unlikely. It looks like perl support for ANTLR3 is very poor. Is there a plan to upgrade to this newer version?

     
  • Oh thanks, I replied before I saw your answer. I'll try this.

     
  • Thanks, it worked like a charm!