From e4c4766c2347c3f5c3b8e90229d763b99d335c44 Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Wed, 18 Mar 2015 05:19:29 +0100 Subject: [PATCH] Bootstrap build --- jflex-skeleton.patch | 86 ++++++++++++++++++++++++++++++++++++++++++++ jflex.spec | 8 ++++- 2 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 jflex-skeleton.patch diff --git a/jflex-skeleton.patch b/jflex-skeleton.patch new file mode 100644 index 0000000..797c203 --- /dev/null +++ b/jflex-skeleton.patch @@ -0,0 +1,86 @@ +--- jflex-1.6.1/src/main/jflex/skeleton.nested 2015-03-15 01:50:30.000000000 +0100 ++++ jflex-1.6.0/src/main/jflex/skeleton.nested 2014-06-02 11:03:10.000000000 +0200 +@@ -15,7 +15,7 @@ + + /* error messages for the codes above */ + private static final String ZZ_ERROR_MSG[] = { +- "Unknown internal scanner error", ++ "Unkown internal scanner error", + "Error: could not match input", + "Error: pushback value was too large" + }; +@@ -162,29 +162,28 @@ + } + + /* fill the buffer with new input */ +- int requested = zzBuffer.length - zzEndRead; +- int numRead = zzReader.read(zzBuffer, zzEndRead, requested); +- +- /* not supposed to occur according to specification of java.io.Reader */ +- if (numRead == 0) { +- throw new java.io.IOException("Reader returned 0 characters. See JFlex examples for workaround."); ++ int requested = zzBuffer.length - zzEndRead; ++ int totalRead = 0; ++ while (totalRead < requested) { ++ int numRead = zzReader.read(zzBuffer, zzEndRead + totalRead, requested - totalRead); ++ if (numRead == -1) { ++ break; ++ } ++ totalRead += numRead; + } +- if (numRead > 0) { +- zzEndRead += numRead; +- /* If numRead == requested, we might have requested to few chars to +- encode a full Unicode character. We assume that a Reader would +- otherwise never return half characters. */ +- if (numRead == requested) { ++ ++ if (totalRead > 0) { ++ zzEndRead += totalRead; ++ if (totalRead == requested) { /* possibly more input available */ + if (Character.isHighSurrogate(zzBuffer[zzEndRead - 1])) { + --zzEndRead; + zzFinalHighSurrogate = 1; + } + } +- /* potentially more input available */ + return false; + } + +- /* numRead < 0 ==> end of stream */ ++ // totalRead = 0: End of stream + return true; + } + +@@ -207,7 +206,7 @@ + * char, and column counting remain untouched. + * + * The current input stream can be restored with +- * yypopStream (usually in an <> action). ++ * yypopstream (usually in an <> action). + * + * @param reader the new input stream to read from + * +@@ -438,15 +437,15 @@ + zzMarkedPos = zzMarkedPosL; + --- char count update + +- if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { +- zzAtEOF = true; +---- eofvalue +- } +- else { + --- actions +- default: ++ default: ++ if (zzInput == YYEOF && zzStartRead == zzCurrentPos) { ++ zzAtEOF = true; ++--- eofvalue ++ } ++ else { + --- no match +- } ++ } + } + } + } diff --git a/jflex.spec b/jflex.spec index 637c785..4185dd6 100644 --- a/jflex.spec +++ b/jflex.spec @@ -1,7 +1,7 @@ Summary: Fast Scanner Generator Name: jflex Version: 1.6.1 -Release: 1%{?dist} +Release: 0.1.bootstrap%{?dist} License: BSD URL: http://jflex.de/ BuildArch: noarch @@ -13,6 +13,8 @@ Source3: %{name}.png Source4: %{name}.1 Source5: create-tarball.sh +Patch0: jflex-skeleton.patch + BuildRequires: maven-local BuildRequires: ant BuildRequires: emacs @@ -42,6 +44,7 @@ This package provides %{summary}. %prep %setup -q +%patch0 -p1 %mvn_file : %{name} %pom_add_dep java_cup:java_cup @@ -96,6 +99,9 @@ install -p -m 644 lib/jflex-mode.elc %{buildroot}%{_emacs_sitelispdir}/%{name} %changelog +* Wed Mar 18 2015 Mikolaj Izdebski - 1.6.1-0.1.bootstrap +- Bootstrap build + * Tue Mar 17 2015 Mikolaj Izdebski - 1.6.1-1 - Update to upstream version 1.6.1