[Chapel Merge] Improve syntax errors for `with` clauses

Branch: refs/heads/main
Revision: ad1bbdf6a8b32d09186fdb901643d683ca6eccd2
Author: jabraham17
Link: Improve syntax errors for `with` clauses by jabraham17 · Pull Request #25611 · chapel-lang/chapel · GitHub
Log Message:
Improve syntax errors for with clauses (#25611)

Adds better error message when a user writes a syntactically bad with
clause. For example something like begin with ref A or begin with (). This should improve the user experience when trying to resolve
syntax errors.

While resolving the test failures that resulted from changing syntax
errors, I realized it would be trivial with this change to also improve
the bad task intent errors. So this PR implements that as well,
resolving the future
test/parallel/taskPar/vass/taskintents-badintents.chpl

Testing

  • full paratest with/without comm
  • make test-frontend

Future Work:

  • Apply the same logic for bad task intents to other places where a user
    could use an incorrect intent, e.g. proc inout foo() {} should say
    "'inout' is not a valid this intent"

[Reviewed by @DanilaFe]

Compare: Comparing b0df85fb02c1f4185ea1330062957f73a96b3e3b...31d8f23ed4313c4d149bb969f4258ee0a98c6c2d · chapel-lang/chapel · GitHub

Diff:
M frontend/lib/parsing/ParserContext.h
M frontend/lib/parsing/ParserContextImpl.h
M frontend/lib/parsing/bison-chpl-lib.cpp
M frontend/lib/parsing/bison-chpl-lib.h
M frontend/lib/parsing/chpl.ypp
M frontend/test/parsing/testParseBegin.cpp
M frontend/test/parsing/testParseCobegin.cpp
M frontend/test/parsing/testParseCoforall.cpp
M frontend/test/parsing/testParseFor.cpp
M frontend/test/parsing/testParseForall.cpp
M frontend/test/parsing/testParseForeach.cpp
M test/parallel/forall/checks/with-false.good
D test/parallel/taskPar/vass/taskintents-badintents.bad
D test/parallel/taskPar/vass/taskintents-badintents.future
M test/parallel/taskPar/vass/taskintents-badintents.good
M test/parallel/taskPar/vass/taskintents-inout-error.good
M test/parallel/taskPar/vass/with-false.good
https://github.com/chapel-lang/chapel/pull/25611.diff