Skip to content

Commit

Permalink
support i", i`, iq{ and istring postfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
WebFreak001 committed Oct 29, 2023
1 parent 3c665c0 commit 496ed47
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/dparse/ast.d
Original file line number Diff line number Diff line change
Expand Up @@ -2363,7 +2363,23 @@ final class InterpolatedString : BaseNode
: Token.init;
}

mixin OpEquals!("startQuote.text");
/// '\0'/'c'/'w'/'d' for `i""`, `i""c`, `i""w` and `i""d` respectively.
char postfixType() inout pure nothrow @nogc @safe scope
{
auto end = endQuote.text;
auto endChar = end.length ? end[$ - 1] : ' ';
switch (endChar)

Check warning on line 2371 in src/dparse/ast.d

View check run for this annotation

Codecov / codecov/patch

src/dparse/ast.d#L2369-L2371

Added lines #L2369 - L2371 were not covered by tests
{
case 'c':
case 'w':
case 'd':
return endChar;
default:
return '\0';

Check warning on line 2378 in src/dparse/ast.d

View check run for this annotation

Codecov / codecov/patch

src/dparse/ast.d#L2373-L2378

Added lines #L2373 - L2378 were not covered by tests
}
}

mixin OpEquals!("startQuote.text", "postfixType");
}

///
Expand Down

0 comments on commit 496ed47

Please sign in to comment.