Skip to content

Commit

Permalink
Adds more whitespaces to avoid misleading errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Baltasarq committed Sep 9, 2023
1 parent 1c7a2bd commit f6ec3b9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/com/devbaltasarq/pooi/core/Lexer.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@

/**
* Lexer for a given String
* @auhtor: baltasarq
* @author: baltasarq
* Date: 11/16/12
*/
public class Lexer {
public static final String OtherWhitespaces = "\u000B\u000C\u0085"
+ "\u00A0\u2000\u2001\u2002\u2003"
+ "\u2004\u2005\u2006\u2007\u2008"
+ "\u2009\u200A\u2028\u2029\u202F"
+ "\u205F\u3000";
public static final String Operators = "+-*/=<>?";
public static final String Delimiters = ":{}()";
public static final String SpecialCharacter = Operators + Delimiters;
Expand All @@ -30,7 +35,10 @@ public void advance(int value)

public boolean isWhiteSpace()
{
return ( Character.isWhitespace( this.getCurrentChar() ) );
final char CH = this.getCurrentChar();

return ( OtherWhitespaces.indexOf( CH ) >= 0
|| Character.isWhitespace( CH ) );
}

public void skipSpaces()
Expand Down

0 comments on commit f6ec3b9

Please sign in to comment.