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

Add one new test file containing 1086 tests of the syntax error messages (plus tooling) #10086

Merged
merged 14 commits into from Dec 21, 2020

Commits on Dec 17, 2020

  1. Fix a typo in a comment.

    fpottier committed Dec 17, 2020
    Configuration menu
    Copy the full SHA
    381081e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7a44158 View commit details
    Browse the repository at this point in the history
  3. Distinguish MENHIRBASICFLAGS and MENHIRFLAGS.

    The former is a subset of the latter, and suffices when running Menhir
    to perform an analysis of the grammar.
    
    This allows [make interpret-menhir] to be used even if ocamlrun and ocamlc
    have not been built yet.
    fpottier committed Dec 17, 2020
    Configuration menu
    Copy the full SHA
    0b85c5b View commit details
    Browse the repository at this point in the history
  4. Define an alias (i.e., concrete syntax) for every token. Add --requir…

    …e-aliases.
    
    The flag --require-aliases makes sure that the property that every token
    has an alias will be preserved in the future.
    
    This requires Menhir 20201214.
    fpottier committed Dec 17, 2020
    Configuration menu
    Copy the full SHA
    13f6b14 View commit details
    Browse the repository at this point in the history
  5. Add [make list-errors].

    This rule runs Menhir's reachability analysis, which produces a list of all
    states where a syntax error can be detected (and a corresponding list of of
    erroneous sentences). This data is stored in parsing/parser.auto.messages.
    
    All text between BEGIN AVOID and END AVOID is removed from the grammar before
    the analysis is run. This can be used to filter out productions and
    declarations that the analysis should ignore.
    fpottier committed Dec 17, 2020
    Configuration menu
    Copy the full SHA
    7af7fbe View commit details
    Browse the repository at this point in the history
  6. Add [make generate-parse-errors].

    This rule turns the error sentences stored in parsing/parser.auto.messages
    into concrete .ml files, which can be used as tests. One file per sentence is
    created. The file name is derived from the sentence. The test files are placed
    in the directory testsuite/tests/generated-parse-errors.
    fpottier committed Dec 17, 2020
    Configuration menu
    Copy the full SHA
    c3ee162 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    092dcb2 View commit details
    Browse the repository at this point in the history
  8. Mark the production that allows puns with [AVOID].

    This prevents [make list-errors] from generating sentences that exploit
    this production. Indeed, there is a risk of generating sentences that
    cause syntax errors, due to the auxiliary function [addlb], which rejects
    certain puns.
    fpottier committed Dec 17, 2020
    Configuration menu
    Copy the full SHA
    5043b8b View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    ae8fa65 View commit details
    Browse the repository at this point in the history
  10. Add one new test file in testsuite/tests/generated-parse-errors/error…

    …s.ml.
    
    This file was produced by [make generate-parse-errors].
    
    This file contains:
        1072 sentences whose start symbol is implementation.
           5 sentences whose start symbol is use_file.
           9 sentences whose start symbol is toplevel_phrase.
    
    The parser's output can be described as follows:
        1086 syntax errors reported.
         721 syntax errors without explanation.
         365 syntax errors with an indication of what was expected.
         307 syntax errors with an indication of an unmatched delimiter.
    fpottier committed Dec 17, 2020
    Configuration menu
    Copy the full SHA
    c318232 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    ee6d974 View commit details
    Browse the repository at this point in the history
  12. Changes.

    fpottier committed Dec 17, 2020
    Configuration menu
    Copy the full SHA
    f016aff View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    6a3e617 View commit details
    Browse the repository at this point in the history

Commits on Dec 21, 2020

  1. Update Changes

    xavierleroy committed Dec 21, 2020
    Configuration menu
    Copy the full SHA
    01d6c4e View commit details
    Browse the repository at this point in the history