Added multiline comments
This commit is contained in:
		
							parent
							
								
									1b45d6a0f9
								
							
						
					
					
						commit
						30fbde8c31
					
				@ -247,8 +247,37 @@ public class LexAn implements AutoCloseable {
 | 
			
		||||
                    return;
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                while (buffChar != '\n' && buffChar != -1) {
 | 
			
		||||
                nextChar();
 | 
			
		||||
                if (buffChar == '{') {
 | 
			
		||||
                    int depth = 1;
 | 
			
		||||
 | 
			
		||||
                    nextChar();
 | 
			
		||||
                    while (depth > 0) {
 | 
			
		||||
                        switch (buffChar) {
 | 
			
		||||
                            case '}':
 | 
			
		||||
                                nextChar();
 | 
			
		||||
                                if (buffChar != '/') continue;
 | 
			
		||||
                                nextChar();
 | 
			
		||||
                                if (buffChar != '/') continue;
 | 
			
		||||
                                depth--;
 | 
			
		||||
                                break;
 | 
			
		||||
                            case '/':
 | 
			
		||||
                                nextChar();
 | 
			
		||||
                                if (buffChar != '/') continue;
 | 
			
		||||
                                nextChar();
 | 
			
		||||
                                if (buffChar != '{') continue;
 | 
			
		||||
                                depth++;
 | 
			
		||||
                                break;
 | 
			
		||||
                            case -1:
 | 
			
		||||
                                throw new Report.Error(currentLocation(), "Unterminated multiline comment");
 | 
			
		||||
                            default:
 | 
			
		||||
                                nextChar();
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                } else {
 | 
			
		||||
                    while (buffChar != '\n' && buffChar != -1) {
 | 
			
		||||
                        nextChar();
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                nextToken();
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user