Skip to content

Commit

Permalink
Use setter for whitespaceControl property
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeckerson committed Oct 25, 2024
1 parent cd6f6da commit 93418db
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
20 changes: 9 additions & 11 deletions src/Scanner/Scanner.php
Original file line number Diff line number Diff line change
Expand Up @@ -1756,7 +1756,7 @@ public function scanForToken(): int
}

vv153:
$this->state->whitespaceControl = false;
$this->state->setWhitespaceControl(false);
$this->token->setOpcode(Compiler::PHVOLT_T_OPEN_DELIMITER);
return 0;

Expand All @@ -1769,12 +1769,10 @@ public function scanForToken(): int
goto vv155;
}
vv155:
{
$this->state->whitespaceControl = false;
$this->state->statementPosition++;
$this->token->setOpcode(Compiler::PHVOLT_T_OPEN_EDELIMITER);
return 0;
}
$this->state->setWhitespaceControl(false);
$this->state->statementPosition++;
$this->token->setOpcode(Compiler::PHVOLT_T_OPEN_EDELIMITER);
return 0;
vv156:
$this->state->incrementStart();
$this->state->setMode(Compiler::PHVOLT_MODE_RAW);
Expand All @@ -1787,13 +1785,13 @@ public function scanForToken(): int
vv160:
$this->state->incrementStart();
$this->state->setMode(Compiler::PHVOLT_MODE_RAW);
$this->state->whitespaceControl = true;
$this->state->setWhitespaceControl(true);
$this->token->setOpcode(Compiler::PHVOLT_T_CLOSE_DELIMITER);
return 0;
vv162:
$this->state->incrementStart();
$this->state->setMode(Compiler::PHVOLT_MODE_RAW);
$this->state->whitespaceControl = true;
$this->state->setWhitespaceControl(true);
$this->token->setOpcode(Compiler::PHVOLT_T_CLOSE_EDELIMITER);
return 0;
vv164:
Expand Down Expand Up @@ -2555,12 +2553,12 @@ public function scanForToken(): int
}
vv207:
$this->state->incrementStart();
$this->state->whitespaceControl = false;
$this->state->setWhitespaceControl(false);
$this->token->setOpcode(Compiler::PHVOLT_T_OPEN_DELIMITER);
return 0;

vv209:
$this->state->whitespaceControl = false;
$this->state->setWhitespaceControl(false);
$this->state->statementPosition++;
$this->token->setOpcode(Compiler::PHVOLT_T_OPEN_EDELIMITER);
return 0;
Expand Down
2 changes: 1 addition & 1 deletion src/Scanner/State.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class State
public int $startLength;
public int $statementPosition = 0;
public int $switchLevel = 0;
public bool $whitespaceControl = false;
private bool $whitespaceControl = false;
protected string $activeFile = 'eval code';
protected int $activeLine = 1;
protected int $cursor = 0;
Expand Down

0 comments on commit 93418db

Please sign in to comment.