From fb00f03512899aaffcf5b9da22b87dd171d0f011d9af08328576b4d33341bb46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Fri, 31 May 2024 14:44:43 +0200 Subject: [PATCH] Sync from SUSE:SLFO:Main jlex revision d61357336ce043fe000f74818b3e7891 --- Main.java | 356 ++++++++++++++++++++-------------------- jlex-1.2.6.static.patch | 19 +-- jlex.changes | 8 + jlex.spec | 10 +- 4 files changed, 198 insertions(+), 195 deletions(-) diff --git a/Main.java b/Main.java index bfb53b1..20d0b06 100644 --- a/Main.java +++ b/Main.java @@ -5,10 +5,6 @@ See below for copyright notice, license, and disclaimer. New releases from http://www.cs.princeton.edu/~appel/modern/java/JLex/ - Version 1.2.6, 2/7/03, [C. Scott Ananian] - Renamed 'assert' function 'ASSERT' to accomodate Java 1.4's new keyword. - Fixed a bug which certain forms of comment in the JLex directives section - (which are not allowed) to be incorrectly parsed as macro definitions. Version 1.2.5, 7/25/99-5/16/00, [C. Scott Ananian] Stomped on one more 8-bit character bug. Should work now (really!). Added unicode support, including unicode escape sequences. @@ -477,8 +473,8 @@ class CEmit { if (CUtility.DEBUG) { - CUtility.ASSERT(null != spec); - CUtility.ASSERT(null != outstream); + CUtility.assert(null != spec); + CUtility.assert(null != outstream); } m_spec = spec; @@ -501,8 +497,8 @@ class CEmit if (CUtility.DEBUG) { - CUtility.ASSERT(null != m_spec); - CUtility.ASSERT(null != m_outstream); + CUtility.assert(null != m_spec); + CUtility.assert(null != m_outstream); }*/ /*m_outstream.println("import java.lang.String;"); @@ -609,8 +605,8 @@ class CEmit if (CUtility.DEBUG) { - CUtility.ASSERT(null != m_spec); - CUtility.ASSERT(null != m_outstream); + CUtility.assert(null != m_spec); + CUtility.assert(null != m_outstream); } if (CUtility.OLD_DEBUG) { @@ -638,8 +634,8 @@ class CEmit { if (CUtility.DEBUG) { - CUtility.ASSERT(null != m_spec); - CUtility.ASSERT(null != m_outstream); + CUtility.assert(null != m_spec); + CUtility.assert(null != m_outstream); } /* Constants */ @@ -826,7 +822,7 @@ class CEmit if (CUtility.DEBUG) { - CUtility.ASSERT(null != state); + CUtility.assert(null != state); } m_outstream.println("\tprivate final int " @@ -865,8 +861,8 @@ class CEmit { if (CUtility.DEBUG) { - CUtility.ASSERT(null != m_spec); - CUtility.ASSERT(null != m_outstream); + CUtility.assert(null != m_spec); + CUtility.assert(null != m_outstream); } /* Function: yy_do_eof */ @@ -1126,8 +1122,8 @@ class CEmit { if (CUtility.DEBUG) { - CUtility.ASSERT(null != m_spec); - CUtility.ASSERT(null != m_outstream); + CUtility.assert(null != m_spec); + CUtility.assert(null != m_outstream); } m_outstream.println(); @@ -1165,8 +1161,8 @@ class CEmit if (CUtility.DEBUG) { - CUtility.ASSERT(null != m_spec); - CUtility.ASSERT(null != m_outstream); + CUtility.assert(null != m_spec); + CUtility.assert(null != m_outstream); } m_outstream.println("\tprivate int yy_acpt[] = {"); @@ -1234,7 +1230,7 @@ class CEmit int[][] yy_nxt = new int[size][]; for (elem=0; elem i); + CUtility.assert(0 <= i); + CUtility.assert(m_spec.m_dtrans_ncols > i); } /* Create new dfa set by attempting character transition. */ @@ -3291,7 +3287,7 @@ class CNfa2Dfa if (CUtility.DEBUG) { - CUtility.ASSERT((null == bunch.m_nfa_set + CUtility.assert((null == bunch.m_nfa_set && null == bunch.m_nfa_bit) || (null != bunch.m_nfa_set && null != bunch.m_nfa_bit)); @@ -3314,7 +3310,7 @@ class CNfa2Dfa if (CUtility.DEBUG) { - CUtility.ASSERT(nextstate < m_spec.m_dfa_states.size()); + CUtility.assert(nextstate < m_spec.m_dfa_states.size()); } dtrans.m_dtrans[i] = nextstate; @@ -3322,7 +3318,7 @@ class CNfa2Dfa if (CUtility.DEBUG) { - CUtility.ASSERT(m_spec.m_dtrans_vector.size() == dfa.m_label); + CUtility.assert(m_spec.m_dtrans_vector.size() == dfa.m_label); } m_spec.m_dtrans_vector.addElement(dtrans); @@ -3375,9 +3371,9 @@ class CNfa2Dfa /* Debug checks. */ if (CUtility.DEBUG) { - CUtility.ASSERT(null != bunch); - CUtility.ASSERT(null != bunch.m_nfa_set); - CUtility.ASSERT(null != bunch.m_nfa_bit); + CUtility.assert(null != bunch); + CUtility.assert(null != bunch.m_nfa_set); + CUtility.assert(null != bunch.m_nfa_bit); } bunch.m_accept = null; @@ -3393,7 +3389,7 @@ class CNfa2Dfa if (CUtility.DEBUG) { - CUtility.ASSERT(bunch.m_nfa_bit.get(state.m_label)); + CUtility.assert(bunch.m_nfa_bit.get(state.m_label)); } nfa_stack.push(state); @@ -3434,8 +3430,8 @@ class CNfa2Dfa if (CUtility.DEBUG) { - CUtility.ASSERT(null != bunch.m_accept); - CUtility.ASSERT(CSpec.NONE == bunch.m_anchor + CUtility.assert(null != bunch.m_accept); + CUtility.assert(CSpec.NONE == bunch.m_anchor || 0 != (bunch.m_anchor & CSpec.END) || 0 != (bunch.m_anchor & CSpec.START)); } @@ -3449,7 +3445,7 @@ class CNfa2Dfa { if (CUtility.DEBUG) { - CUtility.ASSERT(false == bunch.m_nfa_bit.get(state.m_next.m_label)); + CUtility.assert(false == bunch.m_nfa_bit.get(state.m_next.m_label)); } bunch.m_nfa_bit.set(state.m_next.m_label); @@ -3464,7 +3460,7 @@ class CNfa2Dfa { if (CUtility.DEBUG) { - CUtility.ASSERT(false == bunch.m_nfa_bit.get(state.m_next2.m_label)); + CUtility.assert(false == bunch.m_nfa_bit.get(state.m_next2.m_label)); } bunch.m_nfa_bit.set(state.m_next2.m_label); @@ -3515,7 +3511,7 @@ class CNfa2Dfa { if (CUtility.DEBUG) { - CUtility.ASSERT(null == bunch.m_nfa_bit); + CUtility.assert(null == bunch.m_nfa_bit); } bunch.m_nfa_set = new Vector(); @@ -3536,7 +3532,7 @@ class CNfa2Dfa { if (CUtility.DEBUG) { - CUtility.ASSERT(null != bunch.m_nfa_bit); + CUtility.assert(null != bunch.m_nfa_bit); } sortStates(bunch.m_nfa_set); @@ -3664,9 +3660,9 @@ class CNfa2Dfa if (CUtility.DEBUG) { - CUtility.ASSERT(null != bunch.m_nfa_set); - CUtility.ASSERT(null != bunch.m_nfa_bit); - CUtility.ASSERT(null != bunch.m_accept + CUtility.assert(null != bunch.m_nfa_set); + CUtility.assert(null != bunch.m_nfa_bit); + CUtility.assert(null != bunch.m_accept || CSpec.NONE == bunch.m_anchor); } @@ -4084,7 +4080,7 @@ class CInput { if (CUtility.DEBUG) { - CUtility.ASSERT(null != input); + CUtility.assert(null != input); } /* Initialize input stream. */ @@ -4239,10 +4235,10 @@ class CUtility } /******************************************************** - Function: ASSERT + Function: assert Description: Debugging routine. *******************************************************/ - static void ASSERT + static void assert ( boolean expr ) @@ -4930,12 +4926,12 @@ class CLexGen if (CUtility.DEBUG) { - CUtility.ASSERT(null != this); - CUtility.ASSERT(null != m_outstream); - CUtility.ASSERT(null != m_input); - CUtility.ASSERT(null != m_tokens); - CUtility.ASSERT(null != m_spec); - CUtility.ASSERT(m_init_flag); + CUtility.assert(null != this); + CUtility.assert(null != m_outstream); + CUtility.assert(null != m_input); + CUtility.assert(null != m_tokens); + CUtility.assert(null != m_spec); + CUtility.assert(m_init_flag); } /*m_emit.emit_imports(m_spec,m_outstream);*/ @@ -5004,11 +5000,11 @@ class CLexGen if (CUtility.DEBUG) { - CUtility.ASSERT(null != this); - CUtility.ASSERT(null != m_outstream); - CUtility.ASSERT(null != m_input); - CUtility.ASSERT(null != m_tokens); - CUtility.ASSERT(null != m_spec); + CUtility.assert(null != this); + CUtility.assert(null != m_outstream); + CUtility.assert(null != m_input); + CUtility.assert(null != m_tokens); + CUtility.assert(null != m_spec); } if (m_input.m_eof_reached) @@ -5109,7 +5105,7 @@ class CLexGen { if (CUtility.DEBUG) { - CUtility.ASSERT(INIT_CODE == specified + CUtility.assert(INIT_CODE == specified || CLASS_CODE == specified || EOF_CODE == specified || EOF_VALUE_CODE == specified @@ -5423,11 +5419,11 @@ class CLexGen if (CUtility.DEBUG) { - CUtility.ASSERT(null != this); - CUtility.ASSERT(null != m_outstream); - CUtility.ASSERT(null != m_input); - CUtility.ASSERT(null != m_tokens); - CUtility.ASSERT(null != m_spec); + CUtility.assert(null != this); + CUtility.assert(null != m_outstream); + CUtility.assert(null != m_input); + CUtility.assert(null != m_tokens); + CUtility.assert(null != m_spec); } if (m_input.m_eof_reached) @@ -5873,11 +5869,11 @@ class CLexGen if (CUtility.DEBUG) { - CUtility.ASSERT(null != this); - CUtility.ASSERT(null != m_outstream); - CUtility.ASSERT(null != m_input); - CUtility.ASSERT(null != m_tokens); - CUtility.ASSERT(null != m_spec); + CUtility.assert(null != this); + CUtility.assert(null != m_outstream); + CUtility.assert(null != m_input); + CUtility.assert(null != m_tokens); + CUtility.assert(null != m_spec); } /* UNDONE: Need to handle states preceding rules. */ @@ -5895,7 +5891,7 @@ class CLexGen if (CUtility.DEBUG) { - CUtility.ASSERT(END_OF_INPUT == m_spec.m_current_token); + CUtility.assert(END_OF_INPUT == m_spec.m_current_token); } if (m_spec.m_verbose) @@ -6072,8 +6068,8 @@ class CLexGen if (CUtility.DEBUG) { - CUtility.ASSERT(null != state); - CUtility.ASSERT(null != index); + CUtility.assert(null != state); + CUtility.assert(null != index); } System.out.println("State \"" + state @@ -6124,11 +6120,11 @@ class CLexGen if (CUtility.DEBUG) { - CUtility.ASSERT(null != this); - CUtility.ASSERT(null != m_outstream); - CUtility.ASSERT(null != m_input); - CUtility.ASSERT(null != m_tokens); - CUtility.ASSERT(null != m_spec); + CUtility.assert(null != this); + CUtility.assert(null != m_outstream); + CUtility.assert(null != m_input); + CUtility.assert(null != m_tokens); + CUtility.assert(null != m_spec); } states = null; @@ -6276,11 +6272,11 @@ class CLexGen if (CUtility.DEBUG) { - CUtility.ASSERT(null != this); - CUtility.ASSERT(null != m_outstream); - CUtility.ASSERT(null != m_input); - CUtility.ASSERT(null != m_tokens); - CUtility.ASSERT(null != m_spec); + CUtility.assert(null != this); + CUtility.assert(null != m_outstream); + CUtility.assert(null != m_input); + CUtility.assert(null != m_tokens); + CUtility.assert(null != m_spec); } /* Check for macro. */ @@ -6323,7 +6319,7 @@ class CLexGen /* Debug checks. */ if (CUtility.DEBUG) { - CUtility.ASSERT(0 < count_name); + CUtility.assert(0 < count_name); } /* Retrieve macro definition. */ @@ -6350,7 +6346,7 @@ class CLexGen if (CUtility.DEBUG) { - CUtility.ASSERT(rep_elem < replace.length); + CUtility.assert(rep_elem < replace.length); } } @@ -6417,11 +6413,11 @@ class CLexGen if (CUtility.DEBUG) { - CUtility.ASSERT(null != this); - CUtility.ASSERT(null != m_outstream); - CUtility.ASSERT(null != m_input); - CUtility.ASSERT(null != m_tokens); - CUtility.ASSERT(null != m_spec); + CUtility.assert(null != this); + CUtility.assert(null != m_outstream); + CUtility.assert(null != m_input); + CUtility.assert(null != m_tokens); + CUtility.assert(null != m_spec); } /* Macro declarations are of the following form: @@ -6482,8 +6478,6 @@ class CLexGen CError.parse_error(CError.E_MACDEF,m_input.m_line_number); } } - else /* macro definition without = */ - CError.parse_error(CError.E_MACDEF,m_input.m_line_number); /* Skip white space between name and definition. */ while (CUtility.isspace(m_input.m_line[elem])) @@ -6545,9 +6539,9 @@ class CLexGen /* Debug checks. */ if (CUtility.DEBUG) { - CUtility.ASSERT(0 < count_def); - CUtility.ASSERT(0 < count_name); - CUtility.ASSERT(null != m_spec.m_macros); + CUtility.assert(0 < count_def); + CUtility.assert(0 < count_name); + CUtility.assert(null != m_spec.m_macros); } if (CUtility.OLD_DEBUG) @@ -6583,11 +6577,11 @@ class CLexGen if (CUtility.DEBUG) { - CUtility.ASSERT(null != this); - CUtility.ASSERT(null != m_outstream); - CUtility.ASSERT(null != m_input); - CUtility.ASSERT(null != m_tokens); - CUtility.ASSERT(null != m_spec); + CUtility.assert(null != this); + CUtility.assert(null != m_outstream); + CUtility.assert(null != m_input); + CUtility.assert(null != m_tokens); + CUtility.assert(null != m_spec); } /* EOF found? */ @@ -6599,11 +6593,11 @@ class CLexGen /* Debug checks. */ if (CUtility.DEBUG) { - CUtility.ASSERT('%' == m_input.m_line[0]); - CUtility.ASSERT('s' == m_input.m_line[1]); - CUtility.ASSERT(m_input.m_line_index <= m_input.m_line_read); - CUtility.ASSERT(0 <= m_input.m_line_index); - CUtility.ASSERT(0 <= m_input.m_line_read); + CUtility.assert('%' == m_input.m_line[0]); + CUtility.assert('s' == m_input.m_line[1]); + CUtility.assert(m_input.m_line_index <= m_input.m_line_read); + CUtility.assert(0 <= m_input.m_line_index); + CUtility.assert(0 <= m_input.m_line_read); } /* Blank line? No states? */ @@ -6686,9 +6680,9 @@ class CLexGen /* Debug checks. */ if (CUtility.DEBUG) { - CUtility.ASSERT(m_input.m_line_index < m_input.m_line_read); - CUtility.ASSERT(0 < m_input.m_line_read); - CUtility.ASSERT(0 <= m_input.m_line_index); + CUtility.assert(m_input.m_line_index < m_input.m_line_read); + CUtility.assert(0 < m_input.m_line_read); + CUtility.assert(0 <= m_input.m_line_index); } if ('\\' != m_input.m_line[m_input.m_line_index]) @@ -6796,11 +6790,11 @@ class CLexGen if (CUtility.DEBUG) { - CUtility.ASSERT(null != this); - CUtility.ASSERT(null != m_outstream); - CUtility.ASSERT(null != m_input); - CUtility.ASSERT(null != m_tokens); - CUtility.ASSERT(null != m_spec); + CUtility.assert(null != this); + CUtility.assert(null != m_outstream); + CUtility.assert(null != m_input); + CUtility.assert(null != m_tokens); + CUtility.assert(null != m_spec); } /* Get a new line, if needed. */ @@ -6919,7 +6913,7 @@ class CLexGen if (CUtility.DEBUG) { - CUtility.ASSERT(null != accept); + CUtility.assert(null != accept); } if (CUtility.DESCENT_DEBUG) @@ -6947,7 +6941,7 @@ class CLexGen /*if (m_input.m_line_index > m_input.m_line_read) { System.out.println("m_input.m_line_index = " + m_input.m_line_index); System.out.println("m_input.m_line_read = " + m_input.m_line_read); - CUtility.ASSERT(m_input.m_line_index <= m_input.m_line_read); + CUtility.assert(m_input.m_line_index <= m_input.m_line_read); }*/ if (m_input.m_eof_reached) @@ -7007,7 +7001,7 @@ class CLexGen } if (CUtility.DEBUG) { - CUtility.ASSERT(m_input.m_line_index <= m_input.m_line_read); + CUtility.assert(m_input.m_line_index <= m_input.m_line_read); } while (true) @@ -7048,7 +7042,7 @@ class CLexGen if (m_input.m_line_index > m_input.m_line_read) { System.out.println("m_input.m_line_index = " + m_input.m_line_index); System.out.println("m_input.m_line_read = " + m_input.m_line_read); - CUtility.ASSERT(m_input.m_line_index <= m_input.m_line_read); + CUtility.assert(m_input.m_line_index <= m_input.m_line_read); } /* Look for backslash, and corresponding @@ -7159,8 +7153,8 @@ class CLexGen if (CUtility.DEBUG) { - CUtility.ASSERT(null != name); - CUtility.ASSERT(null != def); + CUtility.assert(null != name); + CUtility.assert(null != def); } System.out.println("Macro name \"" + name @@ -7178,8 +7172,8 @@ class CLexGen if (CUtility.DEBUG) { - CUtility.ASSERT(null != state); - CUtility.ASSERT(null != index); + CUtility.assert(null != state); + CUtility.assert(null != index); } System.out.println("State \"" + state @@ -7197,7 +7191,7 @@ class CLexGen { if (CUtility.DEBUG) { - CUtility.ASSERT(m_spec.m_count_lines); + CUtility.assert(m_spec.m_count_lines); } System.out.println("Character counting is on."); @@ -7213,7 +7207,7 @@ class CLexGen { if (CUtility.DEBUG) { - CUtility.ASSERT(m_spec.m_count_lines); + CUtility.assert(m_spec.m_count_lines); } System.out.println("Line counting is on."); @@ -7326,8 +7320,8 @@ class CLexGen if (CUtility.DEBUG) { - CUtility.ASSERT(null != state); - CUtility.ASSERT(null != index); + CUtility.assert(null != state); + CUtility.assert(null != index); } System.out.println("State \"" + state @@ -7504,12 +7498,12 @@ final class SparseBitSet implements Cloneable { bits = nbits; offs = noffs; } - CUtility.ASSERT(sizeoffs[p]) l=p+1; else return p; } - CUtility.ASSERT(l==r); + CUtility.assert(l==r); return l; // index at which the bnum *should* be, if it's not. } @@ -7767,49 +7761,49 @@ final class SparseBitSet implements Cloneable { final int ITER = 500; final int RANGE= 65536; SparseBitSet a = new SparseBitSet(); - CUtility.ASSERT(!a.get(0) && !a.get(1)); - CUtility.ASSERT(!a.get(123329)); - a.set(0); CUtility.ASSERT(a.get(0) && !a.get(1)); - a.set(1); CUtility.ASSERT(a.get(0) && a.get(1)); + CUtility.assert(!a.get(0) && !a.get(1)); + CUtility.assert(!a.get(123329)); + a.set(0); CUtility.assert(a.get(0) && !a.get(1)); + a.set(1); CUtility.assert(a.get(0) && a.get(1)); a.clearAll(); - CUtility.ASSERT(!a.get(0) && !a.get(1)); + CUtility.assert(!a.get(0) && !a.get(1)); java.util.Random r = new java.util.Random(); java.util.Vector v = new java.util.Vector(); for (int n=0; n>>1) % RANGE) << 1; a.set(rr); v.addElement(new Integer(rr)); // check that all the numbers are there. - CUtility.ASSERT(a.get(rr) && !a.get(rr+1) && !a.get(rr-1)); + CUtility.assert(a.get(rr) && !a.get(rr+1) && !a.get(rr-1)); for (int i=0; i>>1) % v.size(); int m = ((Integer)v.elementAt(rr)).intValue(); b.clear(m); v.removeElementAt(rr); // check that numbers are removed properly. - CUtility.ASSERT(!b.get(m)); + CUtility.assert(!b.get(m)); } - CUtility.ASSERT(!a.equals(b)); + CUtility.assert(!a.equals(b)); SparseBitSet c = (SparseBitSet) a.clone(); SparseBitSet d = (SparseBitSet) a.clone(); c.and(a); - CUtility.ASSERT(c.equals(a) && a.equals(c)); + CUtility.assert(c.equals(a) && a.equals(c)); c.xor(a); - CUtility.ASSERT(!c.equals(a) && c.size()==0); + CUtility.assert(!c.equals(a) && c.size()==0); d.or(b); - CUtility.ASSERT(d.equals(a) && !b.equals(d)); + CUtility.assert(d.equals(a) && !b.equals(d)); d.and(b); - CUtility.ASSERT(!d.equals(a) && b.equals(d)); + CUtility.assert(!d.equals(a) && b.equals(d)); d.xor(a); - CUtility.ASSERT(!d.equals(a) && !b.equals(d)); + CUtility.assert(!d.equals(a) && !b.equals(d)); c.or(d); c.or(b); - CUtility.ASSERT(c.equals(a) && a.equals(c)); + CUtility.assert(c.equals(a) && a.equals(c)); c = (SparseBitSet) d.clone(); c.and(b); - CUtility.ASSERT(c.size()==0); + CUtility.assert(c.size()==0); System.out.println("Success."); } } diff --git a/jlex-1.2.6.static.patch b/jlex-1.2.6.static.patch index c9bce8e..da54d46 100644 --- a/jlex-1.2.6.static.patch +++ b/jlex-1.2.6.static.patch @@ -1,6 +1,6 @@ ---- Main.java.orig 2003-03-26 11:47:18.000000000 +0100 -+++ Main.java 2003-03-26 11:47:21.000000000 +0100 -@@ -1072,8 +1072,15 @@ +--- Main.java.orig 2000-09-06 16:09:47.000000000 +0200 ++++ Main.java 2024-02-21 16:03:00.139049849 +0100 +@@ -1068,8 +1068,15 @@ // Added 6/24/98 Raimondas Lencevicius // May be made more efficient by replacing String operations // Assumes correctly formed input String. Performs no error checking @@ -16,7 +16,7 @@ m_outstream.println("\t\tint colonIndex = -1;"); m_outstream.println("\t\tString lengthString;"); m_outstream.println("\t\tint sequenceLength = 0;"); -@@ -1216,13 +1223,23 @@ +@@ -1212,13 +1219,23 @@ int[] yy_cmap = new int[m_spec.m_ccls_map.length]; for (i = 0; i < m_spec.m_ccls_map.length; ++i) yy_cmap[i] = m_spec.m_col_map[m_spec.m_ccls_map[i]]; @@ -40,8 +40,8 @@ emit_table_as_string(new int[][] { m_spec.m_row_map }); m_outstream.println(")[0];"); m_outstream.println(); -@@ -1237,8 +1254,14 @@ - CUtility.ASSERT(dtrans.m_dtrans.length==m_spec.m_dtrans_ncols); +@@ -1233,8 +1250,14 @@ + CUtility.assert(dtrans.m_dtrans.length==m_spec.m_dtrans_ncols); yy_nxt[elem] = dtrans.m_dtrans; } + if (Main.staticFlag) { @@ -55,7 +55,7 @@ emit_table_as_string(yy_nxt); m_outstream.println(");"); m_outstream.println(); -@@ -3825,26 +3848,43 @@ +@@ -3821,18 +3844,35 @@ /*************************************************************** Function: main **************************************************************/ @@ -79,7 +79,6 @@ - { - System.out.println("Usage: JLex.Main "); - return; -- } + // Parse options starting with '-' + for (i = 0; i < arg.length && arg[i].charAt(0) == '-'; i++) { + if (arg[i].equals("-static")) { @@ -93,10 +92,10 @@ + // Enough arguments left ? + if (arg.length - i < 1) { + printUsage(); -+ } + } /* Note: For debuging, it may be helpful to remove the try/catch - block and permit the Exception to propagate to the top level. +@@ -3840,7 +3880,7 @@ This gives more information. */ try { diff --git a/jlex.changes b/jlex.changes index b567fad..e5565ae 100644 --- a/jlex.changes +++ b/jlex.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Wed Feb 21 12:51:43 UTC 2024 - Fridrich Strba + +- Use %patch -P N instead of deprecated %patchN. +- Modified patch: + * jlex-1.2.6.static.patch + + rediff to changed Main.java + ------------------------------------------------------------------- Fri Mar 18 16:44:59 UTC 2022 - Fridrich Strba diff --git a/jlex.spec b/jlex.spec index e3334aa..e2704a2 100644 --- a/jlex.spec +++ b/jlex.spec @@ -1,7 +1,7 @@ # # spec file for package jlex # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -23,8 +23,8 @@ Release: 0 Summary: A Lexical Analyzer Generator for Java License: BSD-3-Clause Group: Development/Libraries/Java -URL: http://www.cs.princeton.edu/~appel/modern/java/JLex/ -Source0: http://www.cs.princeton.edu/~appel/modern/java/JLex/Archive/1.2.5/Main.java +URL: https://www.cs.princeton.edu/~appel/modern/java/JLex/ +Source0: https://www.cs.princeton.edu/~appel/modern/java/JLex/Archive/1.2.5/Main.java Source1: %{name}-%{version}.build.xml Patch0: %{name}-%{version}.static.patch BuildRequires: ant @@ -44,7 +44,9 @@ JLex is a lexical analyzer generator for Java. %prep %setup -q -c -T cp %{SOURCE0} . -%patch0 +%patch -P 0 +# assert is keyword since 1.4 +sed -i "s/assert/ASSERT/g" Main.java cp %{SOURCE1} build.xml %build