Skip to content

Improve faulty parsing. Add semantic snippets#12909

Merged
MarcusDenker merged 12 commits intopharo-project:Pharo11from
privat:improve-faulty-parsing-semantic-snippets
Mar 7, 2023
Merged

Improve faulty parsing. Add semantic snippets#12909
MarcusDenker merged 12 commits intopharo-project:Pharo11from
privat:improve-faulty-parsing-semantic-snippets

Conversation

@privat
Copy link
Contributor

@privat privat commented Mar 6, 2023

This PR does 3 related things

  • Improve and fortify the parse, doSemanticAnalysis and compile methods of RBCodeSnippet.
    • and improve the related tests.
    • add an onError: version to have a "non-faulty" mode that throws errors.
    • and add the related tests on onError version.
  • Teach OCASTTranslator to emit runtime error when trying to assign read-only variable (instead of crashing or corrupting the image).
  • Add new snippets related to semantic errors and warnings
    • Some are OK as is, others need fixmes and skips

These change feels the minimal set to have a bunch of new test that pass CI reasonably (with fixme and skips).

For the sake of simplicity (and reviewability). The following is let to future PR:

  • Handle semantic error in the AST
  • Test semantic warnings (currently, they are just ignored by RBCodeSnippetTest)
  • Do something meaningful with backend error (they should be caught at semantic-time!).

@Ducasse Ducasse requested a review from MarcusDenker March 6, 2023 18:14
@Ducasse
Copy link
Member

Ducasse commented Mar 6, 2023

You look to have a lot of fun and this is super nice to see this :)

@MarcusDenker
Copy link
Member

failing test not related: TKTCommonQueueWorkerPoolTest>>testWorkerPoolDoesNotExceedPoolSizeWhenSchedulingTasksInParallel

@MarcusDenker MarcusDenker merged commit 502f473 into pharo-project:Pharo11 Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants