microsoft/qdk

Public

mirrored fromhttps://github.com/microsoft/qdkAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v1.0.33

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

compiler/qsc_parse/src/lex.rs

51lines · modecode

1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4mod cooked;
5mod raw;
6
7use enum_iterator::Sequence;
8
9pub(super) use cooked::{ClosedBinOp, Error, Lexer, StringToken, Token, TokenKind};
10
11/// A delimiter token.
12#[derive(Clone, Copy, Debug, Eq, PartialEq, Sequence)]
13pub(super) enum Delim {
14 /// `{` or `}`
15 Brace,
16 /// `[` or `]`
17 Bracket,
18 /// `(` or `)`
19 Paren,
20}
21
22#[derive(Clone, Copy, Debug, Eq, PartialEq, Sequence)]
23pub(super) enum Radix {
24 Binary,
25 Octal,
26 Decimal,
27 Hexadecimal,
28}
29
30impl From<Radix> for u32 {
31 fn from(value: Radix) -> Self {
32 match value {
33 Radix::Binary => 2,
34 Radix::Octal => 8,
35 Radix::Decimal => 10,
36 Radix::Hexadecimal => 16,
37 }
38 }
39}
40
41#[derive(Clone, Copy, Debug, Eq, PartialEq, Sequence)]
42pub(super) enum InterpolatedStart {
43 DollarQuote,
44 RBrace,
45}
46
47#[derive(Clone, Copy, Debug, Eq, PartialEq, Sequence)]
48pub(super) enum InterpolatedEnding {
49 Quote,
50 LBrace,
51}
52