Fix ATN config string representation · antlr/antlr-php-runtime@e0f3f17

Original file line numberDiff line numberDiff line change

@@ -157,7 +157,7 @@ public function toString(bool $showAlt): string

157157

$buf .= ',[' . $this->context . ']';

158158

}

159159
160-

if ($this->semanticContext->equals(SemanticContext::none())) {

160+

if (!$this->semanticContext->equals(SemanticContext::none())) {

161161

$buf .= ',' . $this->semanticContext;

162162

}

163163

@@ -177,9 +177,9 @@ public function __toString(): string

177177

$this->state,

178178

$this->alt,

179179

$this->context !== null ? ',[' . $this->context . ']' : '',

180-

$this->semanticContext->equals(SemanticContext::none()) ?

181-

',' . $this->semanticContext :

182-

'',

180+

$this->semanticContext->equals(SemanticContext::none())

181+

? ''

182+

: ',' . $this->semanticContext,

183183

$this->reachesIntoOuterContext > 0 ? ',up=' . $this->reachesIntoOuterContext : '',

184184

);

185185

}