added `LBRACE` and `RBRACE` tokens to lexer

pull/2/head
Michael Ochmann 3 years ago
parent 499b2b6fe4
commit 6100cf0f6b
  1. 8
      src/Lexer.php
  2. 2
      src/Token.php

@ -104,6 +104,14 @@ class Lexer {
$clearBuffer();
array_push($tokens, new Token(TokenType::COLON, $char));
break;
case '{':
$clearBuffer();
array_push($tokens, new Token(TokenType::LBRACE, $char));
break;
case '}':
$clearBuffer();
array_push($tokens, new Token(TokenType::RBRACE, $char));
break;
default:
$buffer .= $char;
break;

@ -22,6 +22,8 @@ enum TokenType {
case PIPE ;
case GT ;
case TAB ;
case LBRACE ;
case RBRACE ;
}
class Token {

Loading…
Cancel
Save