diff --git a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/FourCornerZionStenoLexer.java b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/FourCornerZionStenoLexer.java index 9676435..880fc60 100644 --- a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/FourCornerZionStenoLexer.java +++ b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/FourCornerZionStenoLexer.java @@ -240,17 +240,16 @@ public class FourCornerZionStenoLexer { } final public ScanResult scan(FourCornerZionStenoLexer lexer) { - int cakePoint = lexer.input.get(lexer.inputIndex); - if (cakePoint < blockStart || cakePoint > blockStop) { + int matchPoint = lexer.input.get(lexer.inputIndex); + if (matchPoint < blockStart || matchPoint > blockStop) { return ScanResult.NEXT; } - lexer.fireSignals.fireStateScanner(blockStart, blockStop, cakePoint); // TODO: move below and add idxFirst/stop + next ScanResult result = ScanResult.DONE; int idxFirst = lexer.inputIndex; int idxLast = lexer.inputIndex; while (true) { - cakePoint = lexer.input.get(lexer.inputIndex); + int cakePoint = lexer.input.get(lexer.inputIndex); if (cakePoint < blockStart || cakePoint > blockStop) { break; } @@ -260,8 +259,7 @@ public class FourCornerZionStenoLexer { break; } } - //System.out.println("PROCESS: " + lexer.input.size() + " start: " + idxFirst + " stop: " + idxLast + " currenId: " + lexer.inputIndex); - + lexer.fireSignals.fireStateScannerMatch(blockStart, blockStop, matchPoint, idxFirst, idxLast); process(lexer, idxFirst, idxLast); return result; } diff --git a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/FourCornerZionStenoLexerFire.java b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/FourCornerZionStenoLexerFire.java index 0e63e0b..cb6ea6d 100644 --- a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/FourCornerZionStenoLexerFire.java +++ b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/FourCornerZionStenoLexerFire.java @@ -32,7 +32,7 @@ public interface FourCornerZionStenoLexerFire { void fireStateColumn(int column); - void fireStateScanner(int blockStart, int blockStop, int cakePoint); + void fireStateScannerMatch(int blockStart, int blockStop, int matchPoint, int idxFirst, int idxLast); void fireStateNCR1632BankSparkler(boolean magic); @@ -49,7 +49,7 @@ public interface FourCornerZionStenoLexerFire { } @Override - default void fireStateScanner(int blockStart, int blockStop, int cakePoint) { + default void fireStateScannerMatch(int blockStart, int blockStop, int matchPoint, int idxFirst, int idxLast) { } @Override diff --git a/nx01-x4o-fc18/src/test/java/org/x4o/fc18/zion7/TestFireWalker.java b/nx01-x4o-fc18/src/test/java/org/x4o/fc18/zion7/TestFireWalker.java index 8d9da92..da6299c 100644 --- a/nx01-x4o-fc18/src/test/java/org/x4o/fc18/zion7/TestFireWalker.java +++ b/nx01-x4o-fc18/src/test/java/org/x4o/fc18/zion7/TestFireWalker.java @@ -34,7 +34,7 @@ public class TestFireWalker implements FourCornerZionStenoLexerFire.Adapter { int currentColumn; int scanBlockStart; int scanBlockStop; - int scanCakePoint; + int scanMatchPoint; int ncr1632BankSparkler; int ncr1632BankReset; @@ -46,6 +46,8 @@ public class TestFireWalker implements FourCornerZionStenoLexerFire.Adapter { currentLine = 0; currentColumn = 0; scanBlockStart = 0; + scanMatchPoint = 0; + scanMatchPoint = 0; ncr1632BankSparkler = 0; ncr1632BankReset = 0; } @@ -61,10 +63,10 @@ public class TestFireWalker implements FourCornerZionStenoLexerFire.Adapter { } @Override - public void fireStateScanner(int blockStart, int blockStop, int cakePoint) { + public void fireStateScannerMatch(int blockStart, int blockStop, int matchPoint, int idxFirst, int idxLast) { scanBlockStart = blockStart; scanBlockStop = blockStop; - scanCakePoint = cakePoint; + scanMatchPoint = matchPoint; } @Override