"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/Data/History/commute.cpp" between
TeXmacs-1.99.4-src.tar.gz and TeXmacs-1.99.5-src.tar.gz

About: GNU TeXmacs is a what-you-see-is-what-you-get scientific text editor, which was both inspired by TeX and GNU Emacs.

commute.cpp  (TeXmacs-1.99.4-src):commute.cpp  (TeXmacs-1.99.5-src)
skipping to change at line 76 skipping to change at line 76
{ {
tree u= subtree (t, rp); tree u= subtree (t, rp);
int i= index (m); int i= index (m);
return mod_insert_node (rp, i, copy (u (0, i) * u (i+1, N(u)))); return mod_insert_node (rp, i, copy (u (0, i) * u (i+1, N(u))));
} }
case MOD_SET_CURSOR: case MOD_SET_CURSOR:
return m; return m;
default: default:
FAILED ("unexpected situation"); FAILED ("unexpected situation");
} }
return m;
} }
/****************************************************************************** /******************************************************************************
* Commutation of modifications * Commutation of modifications
******************************************************************************/ ******************************************************************************/
static bool static bool
swap1 (modification& m1, modification& m2, int i, int d) { swap1 (modification& m1, modification& m2, int i, int d) {
modification r1= dup (m2); modification r1= dup (m2);
modification r2= dup (m1); modification r2= dup (m1);
skipping to change at line 310 skipping to change at line 311
path h (rp1->item); path h (rp1->item);
modification s1= m1 / h; modification s1= m1 / h;
modification s2= m2 / h; modification s2= m2 / h;
bool r= swap (s1, s2); bool r= swap (s1, s2);
m1= h * s1; m1= h * s1;
m2= h * s2; m2= h * s2;
return r; return r;
} }
else return swap_basic (m1, m2); else return swap_basic (m1, m2);
FAILED ("unexpected situation"); FAILED ("unexpected situation");
return false;
} }
bool bool
commute (modification m1, modification m2) { commute (modification m1, modification m2) {
// Assuming that m1;m2 (the patch m1 followed by m2) is well-defined, // Assuming that m1;m2 (the patch m1 followed by m2) is well-defined,
// determine whether there exist modifications m1* and m2* such that // determine whether there exist modifications m1* and m2* such that
// m2*;m1* is equivalent to m1;m2 // m2*;m1* is equivalent to m1;m2
modification s1= m1; modification s1= m1;
modification s2= m2; modification s2= m2;
return swap (s1, s2); return swap (s1, s2);
 End of changes. 2 change blocks. 
0 lines changed or deleted 2 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS