Syntax and parsing architecture #19178
              
                Unanswered
              
          
                  
                    
                      vikigenius
                    
                  
                
                  asked this question in
                Q&A
              
            Replies: 1 comment
-
| For lexing we use the rustc lexer. All tokens are lexed before parsing, and it happens here: https://github.com/rust-lang/rust-analyzer/blob/master/crates/parser/src/lexed_str.rs. | 
Beta Was this translation helpful? Give feedback.
                  
                    0 replies
                  
                
            
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
-
I have been reading through the architecture docs to gain and understanding of the design choices made here. It's very helpful.
But the one thing I couldn't get a clear answer on is, how is lexing handled? Is there a separate lexing phase where the file is converted into a list of tokens? Is it lazy? Or is it more of an on demand lexing where the parser determines how and what to lex?
Beta Was this translation helpful? Give feedback.
All reactions