csharp
public static class LiteralParserTurns a literal token's source text into a typed value. The lexer keeps tokens verbatim (quotes, escapes, suffixes and all), so this is where 42f becomes a float.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
A string literal has no runtime type: strings do not exist on a GPU. It still parses, because attribute arguments such as [Semantic("SV_Target")] are compile-time metadata read straight off the syntax. In expression position the binder rejects it.
Methods (1)
public static (TypeSymbol Type, object? Value) Parse(LiteralExpressionSyntax syntax)The type and value a literal expression denotes.
Used by (4)
- BinderVixen.Raven
- DeclarationFactsVixen.Raven
- SourceFieldSymbolVixen.Raven
- SourceParameterSymbolVixen.Raven