now tokenizing spaces

feature/strict-mode
Michael Ochmann 3 years ago
parent 594b85a81e
commit 3b7e772fc7
  1. 4
      src/Lexer.php
  2. 1
      src/Token.php

@ -119,6 +119,10 @@ class Lexer {
$clearBuffer(); $clearBuffer();
array_push($tokens, new Token(TokenType::RBRACE, $char, [$col, $row, $this->fileName])); array_push($tokens, new Token(TokenType::RBRACE, $char, [$col, $row, $this->fileName]));
break; break;
case ' ':
$clearBuffer();
array_push($tokens, new Token(TokenType::SPACE, $char, [$col, $row, $this->fileName]));
break;
default: default:
$buffer .= $char; $buffer .= $char;
break; break;

@ -24,6 +24,7 @@ enum TokenType {
case TAB ; case TAB ;
case LBRACE ; case LBRACE ;
case RBRACE ; case RBRACE ;
case SPACE ;
} }
class Token { class Token {

Loading…
Cancel
Save