Skip to content

Commit

Permalink
removed Token::$offset
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Mar 7, 2022
1 parent d899ece commit ae04edd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Neon/Lexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function tokenize(string $input): TokenStream
}
}

$token = new Token($token[0], $offset, $type);
$token = new Token($token[0], $type);
$offset += strlen($token->value);
}

Expand Down
6 changes: 1 addition & 5 deletions src/Neon/Token.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,13 @@ final class Token
/** @var string */
public $value;

/** @var int */
public $offset;

/** @var int|string */
public $type;


public function __construct(string $value, int $offset, $type)
public function __construct(string $value, $type)
{
$this->value = $value;
$this->offset = $offset;
$this->type = $type;
}
}

0 comments on commit ae04edd

Please sign in to comment.