From 1f0423048a9024dec987a116e4359d8a0e1c325f Mon Sep 17 00:00:00 2001 From: ~hatteb-mitlyd Date: Tue, 10 Jun 2014 11:02:33 -0700 Subject: [PATCH 1/4] re2 palliatives --- Makefile | 1 + gen164/5/repg.c | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index a23366752..d5c35d862 100644 --- a/Makefile +++ b/Makefile @@ -58,6 +58,7 @@ INCLUDE=include MDEFINES=-DU2_OS_$(OS) -DU2_OS_ENDIAN_$(ENDIAN) -D U2_LIB=\"$(LIB)\" CFLAGS= -O2 -g \ + -funsigned-char \ -I/usr/local/include \ -I/opt/local/include \ -I$(INCLUDE) \ diff --git a/gen164/5/repg.c b/gen164/5/repg.c index 585117c79..dc7a595a9 100644 --- a/gen164/5/repg.c +++ b/gen164/5/repg.c @@ -18,7 +18,6 @@ c3_y* rep_y = u2_cr_tape(rep); - char* rec = (char*)lub_y; char* end; while(*rec != 0) { @@ -59,7 +58,7 @@ opt = cre2_opt_new(); if (opt) { cre2_opt_set_log_errors(opt, 0); - cre2_opt_set_encoding(opt, CRE2_Latin1); + cre2_opt_set_encoding(opt, CRE2_UTF8); cre2_opt_set_perl_classes(opt, 1); cre2_opt_set_one_line(opt, 1); cre2_opt_set_longest_match(opt, 1); @@ -76,7 +75,7 @@ if (!match) { if(rad_y[ic]) - ret = u2_cn_cell((u2_atom)rad_y[ic], ret); + ret = u2_cn_cell((c3_y)rad_y[ic], ret); ic++; } else { From ce0ad53cc29aec2466534b52aceb23dcce6356ec Mon Sep 17 00:00:00 2001 From: Luke Patmore Date: Tue, 10 Jun 2014 14:31:16 -0700 Subject: [PATCH 2/4] Improvements to ap.c --- gen164/6/ap.c | 61 ++++++++++++++++++++++++----------------------- include/c/motes.h | 2 ++ 2 files changed, 33 insertions(+), 30 deletions(-) diff --git a/gen164/6/ap.c b/gen164/6/ap.c index 5113a2396..12ce270fa 100644 --- a/gen164/6/ap.c +++ b/gen164/6/ap.c @@ -102,9 +102,7 @@ u2_nul, u2_nul)); } -/*** -**** -***/ + /*** **** ***/ @@ -332,6 +330,13 @@ /*** **** ***/ + _open_do_pq(brcb) // |_ + { + // [%brcb *] [%tsls [%bctr p.gen] [%brcn q.gen]] + return u2_bt(wir_r, c3__tsls, + u2_bc(wir_r, c3__bctr, u2_rx(wir_r, p_gen)), + u2_bc(wir_r, c3__brcn, u2_rx(wir_r, q_gen))); + } _open_do_pq(brkt) // &- { // [%brkt *] [%tsgr [%brcn (~(put by q.gen) %% [%ash p.gen])] %%] @@ -465,12 +470,6 @@ _smcl_in(wir_r, q_gen)); } } -#if 0 - _open_do_p(smdq) - { - return _ap_snig(p_gen); - } -#endif /* functions */ @@ -526,12 +525,10 @@ return u2_bl_bail(wir_r, c3__fail); \ } else return _open_in_##stem(wir_r, p_gen, q_gen, r_gen, s_gen); - _open_pq (tsgl); - _open_pq (tshp); - _open_pq (tsls); - _open_p (brhp); _open_p (brdt); + _open_pq (brcb); + _open_pq (brkt); _open_pq (clcb); _open_pq (clhp); @@ -540,6 +537,27 @@ _open_p (cltr); _open_p (clsg); + _open_pq (cncl); + _open_pq (cndt); + _open_pqrs(cnkt); + _open_pq (cnhp); + _open_pqr (cnls); + _open_pqr (cnsg); + + _open_pq (sgts); + _open_pq (sgbr); + _open_pq (sggl); + _open_pq (sgbc); + _open_pqrs(sgcn); + _open_pq (sgls); + + _open_pq (smcl); + // _open_pq (smsg); + + _open_pq (tsgl); + _open_pq (tshp); + _open_pq (tsls); + _open_pqr (wtdt); _open_pq (wtgl); _open_p (wtzp); @@ -550,25 +568,8 @@ _open_pq (wthp); _open_pq (wtgr); - _open_pq (cncl); - _open_pq (cndt); - _open_pqrs(cnkt); - _open_pq (cnhp); - _open_pqr (cnls); - _open_pqr (cnsg); - _open_pq (brkt); - _open_pq (sgts); - _open_pq (sgbr); - _open_pq (sggl); - _open_pq (sgbc); - _open_pqrs(sgcn); - _open_pq (sgls); - - _open_pq (smcl); - // _open_p (smdq); - // _open_pq (smsg); } } diff --git a/include/c/motes.h b/include/c/motes.h index 1abbdd586..87a976952 100644 --- a/include/c/motes.h +++ b/include/c/motes.h @@ -4,6 +4,7 @@ */ /** Definitions. **/ + # define c3__abo c3_s3('a','b','o') # define c3__actd c3_s4('a','c','t','d') # define c3__add c3_s3('a','d','d') @@ -97,6 +98,7 @@ # define c3__bran c3_s4('b','r','a','n') # define c3__brax c3_s4('b','r','a','x') # define c3__brbn c3_s4('b','r','b','n') +# define c3__brcb c3_s4('b','r','c','b') # define c3__brcn c3_s4('b','r','c','n') # define c3__brcs c3_s4('b','r','c','s') # define c3__brdg c3_s4('b','r','d','g') From 810f83bc6f79727cee8759cb9a275e6bf4002a5a Mon Sep 17 00:00:00 2001 From: Luke Patmore Date: Tue, 10 Jun 2014 17:51:43 -0700 Subject: [PATCH 3/4] Added wtkt macro expansion --- gen164/6/ap.c | 22 ++++++++++++---------- include/c/motes.h | 2 ++ 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/gen164/6/ap.c b/gen164/6/ap.c index 12ce270fa..5021796d2 100644 --- a/gen164/6/ap.c +++ b/gen164/6/ap.c @@ -122,6 +122,17 @@ _open_in_wtbr(wir_r, tp_gen)); } } + _open_do_pqr(wtkt) // ?^ + { + // [%wtkt *] [%wtcl [%wtts [%axil %atom %$] p.gen] r.gen q.gen] + return u2_bq + (wir_r, c3__wtcl, + u2_bt(wir_r, c3__wtts, + u2_bt(wir_r, c3__axil, c3__atom, u2_blip), + u2_rx(wir_r, p_gen)), + u2_rx(wir_r, r_gen), + u2_rx(wir_r, q_gen)); + } _open_do_pq(wtgl) // ?< { return u2_bq @@ -208,7 +219,6 @@ ***/ _open_do_pq(clhp) // :- { - printf("wongwong!\n"); return u2_bc (wir_r, u2_rx(wir_r, p_gen), u2_rx(wir_r, q_gen)); @@ -529,42 +539,34 @@ _open_p (brdt); _open_pq (brcb); _open_pq (brkt); - _open_pq (clcb); _open_pq (clhp); _open_pqrs(clkt); _open_pqr (clls); _open_p (cltr); _open_p (clsg); - _open_pq (cncl); _open_pq (cndt); _open_pqrs(cnkt); _open_pq (cnhp); _open_pqr (cnls); _open_pqr (cnsg); - _open_pq (sgts); _open_pq (sgbr); _open_pq (sggl); _open_pq (sgbc); _open_pqrs(sgcn); _open_pq (sgls); - _open_pq (smcl); - // _open_pq (smsg); - _open_pq (tsgl); _open_pq (tshp); _open_pq (tsls); - _open_pqr (wtdt); _open_pq (wtgl); _open_p (wtzp); _open_p (wtbr); + _open_pqr (wtkt); //testing _open_p (wtpm); - // _open_pqr (wtls); - // _open_pqr (wtsg); _open_pq (wthp); _open_pq (wtgr); diff --git a/include/c/motes.h b/include/c/motes.h index 87a976952..d8507b591 100644 --- a/include/c/motes.h +++ b/include/c/motes.h @@ -22,6 +22,7 @@ # define c3__at c3_s2('a','t') # define c3__atom c3_s4('a','t','o','m') # define c3__axe c3_s3('a','x','e') +# define c3__axil c3_s4('a','x','i','l') # define c3__axis c3_s4('a','x','i','s') # define c3__bac c3_s3('b','a','c') # define c3__bach c3_s4('b','a','c','h') @@ -1104,6 +1105,7 @@ # define c3__wtgr c3_s4('w','t','g','r') # define c3__wthp c3_s4('w','t','h','p') # define c3__wthx c3_s4('w','t','h','x') +# define c3__wtkt c3_s4('w','t','k','t') # define c3__wtls c3_s4('w','t','l','s') # define c3__wtms c3_s4('w','t','m','s') # define c3__wtpm c3_s4('w','t','p','m') From 0cdcd642679d3352a555c7cf5c16ffdb6e1c0811 Mon Sep 17 00:00:00 2001 From: Luke Patmore Date: Tue, 10 Jun 2014 18:09:47 -0700 Subject: [PATCH 4/4] Fixed wtls macro expansion --- gen164/6/ap.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/gen164/6/ap.c b/gen164/6/ap.c index 5021796d2..42f821750 100644 --- a/gen164/6/ap.c +++ b/gen164/6/ap.c @@ -193,10 +193,9 @@ u2_bt(wir_r, c3__dtzz, 'f', u2_no)); } } -#if 0 _open_do_pqr(wtls) // ?+ { u2_noun tul = u2_bc(wir_r, - u2_bc(wir_r, u2_bc(wir_r, c3__bcts, c3__noun), + u2_bc(wir_r, u2_bc(wir_r, c3__axil, c3__noun), u2_rx(wir_r, q_gen)), u2_nul); u2_noun zal = j2_mbc(Pt2, weld)(wir_r, r_gen, tul); @@ -205,7 +204,6 @@ u2_rz(wir_r, tul); return ret; } -#endif _open_do_p(wtzp) // ?! { return u2_bq @@ -565,13 +563,11 @@ _open_pq (wtgl); _open_p (wtzp); _open_p (wtbr); - _open_pqr (wtkt); //testing - _open_p (wtpm); _open_pq (wthp); _open_pq (wtgr); - - - + _open_pqr (wtls); + _open_pqr (wtkt); + _open_p (wtpm); } }