Skip to content

Commit

Permalink
Fix for issue#8134 (#8137)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben-Epstein authored and LeeTZ committed Oct 3, 2019
1 parent 90e3d05 commit 4b1b18f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ RUN conda install -y -n beakerx -c conda-forge jupyterhub jupyterlab pyzmq pytes
ENV LANG=en_US.UTF-8
ENV LC_CTYPE=en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
ENV REMOVE_DASH_LINECOMMENT="true"
ENV SHELL /bin/bash
ENV NB_UID 1000
ENV HOME /home/$NB_USER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,13 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.twosigma.beakerx.util.BeakerXSystem;

public class QueryParser {

private static String rd = beakerXSystem.getenv("REMOVE_DASH_LINECOMMENT");
private static boolean REMOVE_DASH_LINECOMMENT = (rd==null) || (rd.equals("true"));

private static final List<ParsingState> PARSING_STATES = Arrays.asList(
new ParsingState("'", "'", false), // string literal
new ParsingState("/*", "*/", true),
Expand Down Expand Up @@ -84,7 +89,7 @@ private static ParsingState getSuitableState(StringBuilder line, int index) {
private static class LineCommentParsingState extends ParsingState {

public LineCommentParsingState(String start) {
super(start, "\n", true);
super(start, "\n", REMOVE_DASH_LINECOMMENT);
}
}

Expand Down

0 comments on commit 4b1b18f

Please sign in to comment.