diff options
| author | Ben Bridle <ben@derelict.engineering> | 2025-04-26 13:00:51 +1200 |
|---|---|---|
| committer | Ben Bridle <ben@derelict.engineering> | 2025-04-26 13:00:51 +1200 |
| commit | e5447e2568e24db9a5218bbe452b856266ca39ae (patch) | |
| tree | e5425bf49fb7ff93b8c46a80b8742a85ecf19fe4 /src/stages/syntactic_tokens.rs | |
| parent | 83e5107684a37aa825d626c19a2af7fd6bfc231a (diff) | |
| download | torque-asm-e5447e2568e24db9a5218bbe452b856266ca39ae.zip | |
Implement first-class string literals
This feature promotes strings to a first-class type in the language.
If a string is passed to an invocation via the new string-type argument,
the string will be passed as a whole value. String arguments can still
be passed to an invocation via an integer-type argument, in which case
they'll be broken apart into individual characters with the macro being
invoked once per character.
String-type macro arguments are declared like "name".
Diffstat (limited to 'src/stages/syntactic_tokens.rs')
| -rw-r--r-- | src/stages/syntactic_tokens.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/stages/syntactic_tokens.rs b/src/stages/syntactic_tokens.rs index 5bfa0be..5a0ac9e 100644 --- a/src/stages/syntactic_tokens.rs +++ b/src/stages/syntactic_tokens.rs @@ -23,6 +23,7 @@ pub struct SyntacticMacroDefinition { pub body: Vec<Tracked<SyntacticToken>>, } +#[derive(Clone)] pub struct StringLiteral { pub string: String, pub chars: Vec<Tracked<isize>>, |
