Skip to content

Commit

Permalink
Fix ATN config string representation
Browse files Browse the repository at this point in the history
  • Loading branch information
marcospassos committed Nov 21, 2022
1 parent 52a44ac commit e0f3f17
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Atn/ATNConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public function toString(bool $showAlt): string
$buf .= ',[' . $this->context . ']';
}

if ($this->semanticContext->equals(SemanticContext::none())) {
if (!$this->semanticContext->equals(SemanticContext::none())) {
$buf .= ',' . $this->semanticContext;
}

Expand All @@ -177,9 +177,9 @@ public function __toString(): string
$this->state,
$this->alt,
$this->context !== null ? ',[' . $this->context . ']' : '',
$this->semanticContext->equals(SemanticContext::none()) ?
',' . $this->semanticContext :
'',
$this->semanticContext->equals(SemanticContext::none())
? ''
: ',' . $this->semanticContext,
$this->reachesIntoOuterContext > 0 ? ',up=' . $this->reachesIntoOuterContext : '',
);
}
Expand Down

0 comments on commit e0f3f17

Please sign in to comment.