Skip to content

Add an error message for illegal start of simple pattern - Parsers.scala:1437 #1700

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

Merged
merged 1 commit into from
Nov 16, 2016
Merged

Add an error message for illegal start of simple pattern - Parsers.scala:1437 #1700

merged 1 commit into from
Nov 16, 2016

Conversation

maseev
Copy link
Contributor

@maseev maseev commented Nov 11, 2016

This pull request is related to the following issue.

case class IllegalStartOfSimplePattern()(implicit ctx: Context) extends Message(32) {
val kind = "Syntax"
val msg = "illegal start of simple pattern"
val explanation = ""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This message doesn't really add anything to justify its existence currently. Some things to consider for the explanation:

  • When does this occur?
  • What is a simple expression?
  • Is there perhaps something that could be added to the message in order to help tooling / the user?

Let's try to put some semantics into this :)

@maseev
Copy link
Contributor Author

maseev commented Nov 14, 2016

@felixmulder PTAL

Copy link
Contributor

@felixmulder felixmulder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor changes needed otherwise LGTM 👍

| case List(_, second, x:_*) => second
| case _ => 0
|}"""
hl"""|Simple pattern can be divided into several groups:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

patterns*

| A special case is the wild-card pattern _ which is treated as if it was a fresh
| variable on each occurrence.
|
|- Typed Patterns: ${"case x:Int => ..."} or ${"case _:Int => ..."}.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

space after :

@maseev
Copy link
Contributor Author

maseev commented Nov 15, 2016

@felixmulder PTAL. BTW, I ran the 'partest' task from 'sbt' and here's what I've got:

1802/1802 passed (elapsed time: 00:18:50)
Test Run PASSED
[success] Total time: 1134 s, completed Nov 15, 2016 6:52:46 PM

I'm not really sure why the jenkins build failed 😞

@felixmulder
Copy link
Contributor

Let's just try rebuilding on the CI first

@felixmulder
Copy link
Contributor

/rebuild

@maseev
Copy link
Contributor Author

maseev commented Nov 15, 2016

it failed again :(

@felixmulder
Copy link
Contributor

Hmm, yes. Your branch's working on my machine - @smarter, could you rerun this on a different behemoth?

@maseev
Copy link
Contributor Author

maseev commented Nov 16, 2016

@felixmulder Looks like it's working again! PTAL

@felixmulder felixmulder merged commit b8262a5 into scala:master Nov 16, 2016
@felixmulder
Copy link
Contributor

LGTM, thanks @maseev!

@maseev maseev deleted the iss1589-illegal-start-simple-pattern branch November 16, 2016 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants