oakes / Nightcode

An IDE for Clojure

Home Page:https://sekao.net/nightcode/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Regex flags and lookbehind/lookahead fail

peter-lyons-kehl opened this issue · comments

Dear Zach @oakes,

Regex literals #"..." don't work with some flags (specifiers) as per bottom of https://nakkaya.com/2009/10/25/regular-expressions-in-clojure/, and with Java regex lookbehind.

#"(?s)abc", #"(?d)abc") and potentially other modifiers fail:
image
But other flags work: #"(?i)a", #"(?m)a" and #"(?u)a".

Then see "Special constructs" at https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html:
#"(?<=X)abc" and #"(?<!X)abc", fail too:
image
But other asserts work: negative lookahead #"(?!X)abc" and positive lookahead #"(?=X)a".

You're probably overloaded. Would you like a hand? If you shed a light on where in Nightcode source this is handled, I'll gladly provide a fix.

Hey peter, I haven't forgotten about the open issues, I've just been taking a break from coding for a bit. I've been working on my banjo among other things :D The thing that determines the inline errors is my fork of tools.reader which paren-soup uses: https://github.com/oakes/tools.reader I thought I fixed this particular bug before....is it the same thing as #225? I thought I fixed that.

Damn, it seems that the bug in that issue is still a problem. Thanks for letting me know, i'll take a look at it.

Hi Zach,

Thank you for noticing. I looked at paren-soup and oakes/tools.reader. For me it's too complex.

Good news: Only some of the flags, and only lookbehinds, are not working. I've updated the examples in the 1st comment.

This is now fixed in master. Sorry it took so long :(

Hi Zach,

Thank you.
How do you build it? I have boot 2.8.2, CLJ 1.10, OpenJDK 1.8.0_192. I haven't used boot before. Running boot build fails:
java.lang.ClassNotFoundException: javafx.application.Application
clojure.lang.Compiler$CompilerException: Unexpected error macroexpanding clojure.core/gen-class at (nightcode/core.clj:1:1).

Do I need Oracle's Java, and is 1.8 enough? Or which libraries do I need with OpenJDK?

Thank you also for play-cljs. Our small group in Vancouver is thinking of attending Global Game Jam. We may use your play-cljs.

Yeah you'll need Oracle's Java. I will fix that soon, once I update nightcode to use the new external javafx libraries. Right now it assumes that javafx is part of the JDK, which is only true for the oracle version. Really great to hear you're using play-cljs. I haven't given it much love lately but that will change this year because I have a new project that will be using it.

BTW if you are on linux, you should be able to just install the openjfx package to compile with openjdk.

Apparently I can upload files, I didn't realize that...so here ya go:

Nightcode.jar.zip

Hi Zach,

I installed OpenJFX and can build now.

However, both your build and my build (of master)

  1. don't run with OpenJDK+OpenJFX. Some native exception in OpenJFX. I can ignore that.
  2. do run with Oracle's jdk1.8.0_191, but InstaREPL doesn't evaluate, and "Run with REPL" and button to its right are disabled:

image

In shell:

(java:23913): Gtk-WARNING **: 23:53:01.116: Unable to locate theme engine in module_path: "murrine",
Jan 20, 2019 11:53:08 PM com.sun.javafx.scene.control.skin.VirtualFlow addTrailingCells
INFO: index exceeds maxCellCount. Check size calculations for class com.sun.javafx.scene.control.skin.TreeViewSkin$1

The instaREPL will not evaluate strings or number literals on their own. Try wrapping it in a (do ...). As for the Run with REPL button being disabled, are you sure that is a valid leiningen project?

Good news...I got it working with openjdk. Try pulling the latest commit. Make sure you have OpenJDK 11. You don't even need openjfx installed anymore, because it is pulling JavaFX as a maven dependency now. Let me know if it doesn't work for you.

I released version 2.7.0 (only a jar for now) so I'll close this ticket:

https://github.com/oakes/Nightcode/releases/tag/2.7.0