Skip to content

Commit

Permalink
Merge pull request #8 from codinuum/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
codinuum authored Apr 14, 2021
2 parents 5248f1e + 3d39a95 commit 88ea07f
Show file tree
Hide file tree
Showing 18 changed files with 6,649 additions and 5,819 deletions.
8 changes: 2 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,8 @@ COPY src /root/src/
RUN set -x && \
cd /root && \
opam init -y --disable-sandboxing && \
eval $(opam config env) && \
opam install -y camlzip cryptokit csv git-unix menhir ocamlnet pxp ulex uuidm pcre && \
git clone https://github.com/codinuum/volt && \
cd volt && sh configure && make all && make install && \
cd /root && \
rm -r volt && \
eval $(opam env) && \
opam install -y camlzip cryptokit csv git-unix menhir ocamlnet pxp ulex uuidm pcre volt && \
cd src && \
make && \
cd ast/analyzing && \
Expand Down
50 changes: 38 additions & 12 deletions diffviewer/diffviewer3.js
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,10 @@

}
var cmp = function(a, b) {
return a.from.line - b.from.line;
var x = a.from.line - b.from.line;
if (x === 0)
x = b.to.line - a.to.line;
return x;
}
this.marksL.sort(cmp);
this.marksR.sort(cmp);
Expand All @@ -1050,17 +1053,40 @@
DtsScrollbarAnnotation.prototype.mark = function() {
if (this.annotationL && this.annotationR) {
//console.log("marking...");
/*
for (var i = 0; i < this.marksL.length; i++) {
var m = this.marksL[i];
console.log('L: ['+m.from.line+'-'+m.to.line+']');
if (this.marksL.length > 0) {
var from = this.marksL[0].from.line;
var to = this.marksL[0].to.line;
var marks = [this.marksL[0]];
for (var i = 0; i < this.marksL.length; i++) {
var m = this.marksL[i];
//console.log('L: ['+m.from.line+'-'+m.to.line+']');
if (from !== undefined && to !== undefined) {
if (to < m.from.line) {
from = m.from.line;
to = m.to.line;
marks.push(m);
}
}
}
this.marksL = marks;
}
for (var i = 0; i < this.marksR.length; i++) {
var m = this.marksR[i];
console.log('R: ['+m.from.line+'-'+m.to.line+']');
if (this.marksR.length > 0) {
var from = this.marksR[0].from.line;
var to = this.marksR[0].to.line;
var marks = [this.marksR[0]];
for (var i = 0; i < this.marksR.length; i++) {
var m = this.marksR[i];
//console.log('R: ['+m.from.line+'-'+m.to.line+']');
if (from !== undefined && to !== undefined) {
if (to < m.from.line) {
from = m.from.line;
to = m.to.line;
marks.push(m);
}
}
}
this.marksR = marks;
}
*/
try { // the following occasionally fails
this.annotationL.update(this.marksL);
this.annotationR.update(this.marksR);
Expand All @@ -1074,13 +1100,13 @@
//try { // the following occasionally fails

try {
if (this.annotationL)
if (this.annotationL !== null)
this.annotationL.clear();
} catch (exn) {
console.log("annotationL: caught exception: "+exn);
}
try {
if (this.annotationR)
if (this.annotationR !== null)
this.annotationR.clear();
} catch (exn) {
console.log("annotationR: caught exception: "+exn);
Expand Down
10 changes: 5 additions & 5 deletions src/ast/analyzing/common/astml.ml
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ let parser_tbl = (* PREFIX * NS *)
let get_prefix_by_ns ns =
let rec loop = function
| (p, ns')::rest ->
if ns = ns' then
p
else
loop rest
if ns = ns' then
p
else
loop rest
| [] ->
raise Not_found
raise Not_found
in
loop parser_tbl

Expand Down
Loading

0 comments on commit 88ea07f

Please sign in to comment.