...
This commit is contained in:
@@ -16,15 +16,11 @@ public record IntLiteralToken(SourceSpan Span, string Value, int Base) : Token(S
|
||||
{
|
||||
private string GetNumericValue()
|
||||
{
|
||||
// Strip base prefixes: 0b, 0o, 0x
|
||||
return Base switch
|
||||
{
|
||||
2 when Value.StartsWith("0b", StringComparison.OrdinalIgnoreCase)
|
||||
=> Value.Substring(2),
|
||||
8 when Value.StartsWith("0o", StringComparison.OrdinalIgnoreCase)
|
||||
=> Value.Substring(2),
|
||||
16 when Value.StartsWith("0x", StringComparison.OrdinalIgnoreCase)
|
||||
=> Value.Substring(2),
|
||||
2 when Value.StartsWith("0b", StringComparison.OrdinalIgnoreCase) => Value[2..],
|
||||
8 when Value.StartsWith("0o", StringComparison.OrdinalIgnoreCase) => Value[2..],
|
||||
16 when Value.StartsWith("0x", StringComparison.OrdinalIgnoreCase) => Value[2..],
|
||||
_ => Value
|
||||
};
|
||||
}
|
||||
@@ -95,7 +91,6 @@ public enum Symbol
|
||||
Func,
|
||||
Struct,
|
||||
Enum,
|
||||
Import,
|
||||
Module,
|
||||
|
||||
// Modifier
|
||||
@@ -159,7 +154,6 @@ public record SymbolToken(SourceSpan Span, Symbol Symbol) : Token(Span)
|
||||
Symbol.Extern => "extern",
|
||||
Symbol.Module => "module",
|
||||
Symbol.Export => "export",
|
||||
Symbol.Import => "import",
|
||||
Symbol.Defer => "defer",
|
||||
Symbol.Enum => "enum",
|
||||
Symbol.Equal => "==",
|
||||
|
||||
Reference in New Issue
Block a user