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 9207752..e5565ae 100644 --- a/jlex.changes +++ b/jlex.changes @@ -2,6 +2,9 @@ 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 1f4f350..e2704a2 100644 --- a/jlex.spec +++ b/jlex.spec @@ -45,6 +45,8 @@ JLex is a lexical analyzer generator for Java. %setup -q -c -T cp %{SOURCE0} . %patch -P 0 +# assert is keyword since 1.4 +sed -i "s/assert/ASSERT/g" Main.java cp %{SOURCE1} build.xml %build