Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/keenquotes.git

Fix lexer test

AuthorDave Jarvis <email>
Date2021-06-20 14:26:16 GMT-0700
Commit9eb983d4be2d57c9859c22c89318d1658898afa7
Parent8a075f9
src/main/java/com/whitemagicsoftware/keenquotes/Lexer.java
lexeme = createLexeme( QUOTE_SINGLE_CLOSING, began, i.getIndex() );
}
- else if( curr == '-' && peek( i ) != '-' ) {
- lexeme = createLexeme( HYPHEN, began, i.getIndex() );
- }
- else if( isDash( curr ) ) {
- slurp( i, ( next, ci ) -> isDash( next ) );
-
- lexeme = createLexeme( DASH, began, i.getIndex() );
- }
else if( isDigit( curr ) || isNumeric( curr ) && isDigit( peek( i ) ) ) {
// Parse all consecutive number characters to prevent the main loop
// from switching back to word tokens.
slurp( i, ( next, ci ) ->
isDigit( next ) || isNumeric( next ) && isDigit( peek( ci ) )
);
lexeme = createLexeme( isWord ? WORD : NUMBER, began, i.getIndex() );
+ }
+ else if( curr == '-' && peek( i ) != '-' ) {
+ lexeme = createLexeme( HYPHEN, began, i.getIndex() );
+ }
+ else if( isDash( curr ) ) {
+ slurp( i, ( next, ci ) -> isDash( next ) );
+
+ lexeme = createLexeme( DASH, began, i.getIndex() );
}
else if( curr == '.' ) {
Delta8 lines added, 8 lines removed