Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support i", i`, iq{ and istring postfixes
Browse files Browse the repository at this point in the history
WebFreak001 committed Oct 29, 2023

Verified

This commit was signed with the committer’s verified signature.
WebFreak001 Jan Jurzitza
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
@@ -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)
{
case 'c':
case 'w':
case 'd':
return endChar;
default:
return '\0';
}
}

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

///

0 comments on commit 496ed47

Please sign in to comment.