Raise compilation error for string interpolation in group name

This commit is contained in:
Michael Miller 2022-01-10 21:11:28 -07:00
parent 941b91fef4
commit aabec269cb
No known key found for this signature in database
GPG key ID: AC78B32D30CE34A2

View file

@ -130,9 +130,10 @@ module Spectator::DSL
what.resolve?.is_a?(TypeNode) %} what.resolve?.is_a?(TypeNode) %}
{{what.symbolize}} {{what.symbolize}}
{% elsif what.is_a?(StringLiteral) || {% elsif what.is_a?(StringLiteral) ||
what.is_a?(StringInterpolation) ||
what.is_a?(NilLiteral) %} what.is_a?(NilLiteral) %}
{{what}} {{what}}
{% elsif what.is_a?(StringInterpolation) %}
{% raise "String interpolation isn't supported for example group names" %}
{% else %} {% else %}
{{what.stringify}} {{what.stringify}}
{% end %} {% end %}