Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(parser): trailing comma is not allowed in ParenthesizedExpression #3885

Commits on Jun 24, 2024

  1. fix(parser): trailing comma is not allowed in ParenthesizedExpression (

    …#3885)
    
    close: #3878
    
    The implementation is copied from `SeparatedList`'s `print_list`.
    ```diff
        fn parse_list(&mut self, p: &mut ParserImpl<'a>) -> Result<()> {
            p.expect(self.open())?;
    
            let mut first = true;
    
            while !p.at(self.close()) && !p.at(Kind::Eof) {
                if first {
                    first = false;
                } else {
                    p.expect(self.separator())?;
    -                if p.at(self.close()) {
    -                    break;
    -               }
                }
    
                self.parse_element(p)?;
            }
    
            p.expect(self.close())?;
            Ok(())
        }
    ```
    Dunqing committed Jun 24, 2024
    Configuration menu
    Copy the full SHA
    ef82c78 View commit details
    Browse the repository at this point in the history