Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Can use a dot instead of a comma #100

Closed
jsiebern opened this issue Aug 12, 2020 · 1 comment · Fixed by #101
Closed

Can use a dot instead of a comma #100

jsiebern opened this issue Aug 12, 2020 · 1 comment · Fixed by #101

Comments

@jsiebern
Copy link

I just came across this while writing some bindings:

module ModalContent = {
  @react.component @bs.module("semantic-ui-react")
  external make: (
    ~style: ReactDOMRe.Style.t=?.
    ~image: bool=?,
  ) => React.element = "ModalContent";
}

Look at the end of the style argument. The compiler accepts the . instead of the , seemingly just fine. You can also write it in one line without spaces, still doesn't complain.

IwanKaramazow pushed a commit that referenced this issue Aug 12, 2020
When a comma is missing between nodes in a region and the current token looks like the start of something valid in the current region, we should report an error with regards to the missing comma.

Example:
  type student<'extraInfo> = {
    name: string,
    age: int
    otherInfo: 'extraInfo
  }
There is a missing comma between `int` and `otherInfo`.
`otherInfo` looks like a valid start of the record declaration.
We report the error here and then continue parsing the region.

Fixes #100
@IwanKaramazow
Copy link
Contributor

@jsiebern Thanks for the report! This parser is too powerful, will make it a bit more strict

IwanKaramazow added a commit that referenced this issue Aug 12, 2020
When a comma is missing between nodes in a region and the current token looks like the start of something valid in the current region, we should report an error with regards to the missing comma.

Example:
  type student<'extraInfo> = {
    name: string,
    age: int
    otherInfo: 'extraInfo
  }
There is a missing comma between `int` and `otherInfo`.
`otherInfo` looks like a valid start of the record declaration.
We report the error here and then continue parsing the region.

Fixes #100
kevinbarabash pushed a commit to kevinbarabash/rescript-compiler that referenced this issue Dec 24, 2021
…ng#101)

When a comma is missing between nodes in a region and the current token looks like the start of something valid in the current region, we should report an error with regards to the missing comma.

Example:
  type student<'extraInfo> = {
    name: string,
    age: int
    otherInfo: 'extraInfo
  }
There is a missing comma between `int` and `otherInfo`.
`otherInfo` looks like a valid start of the record declaration.
We report the error here and then continue parsing the region.

Fixes rescript-lang/syntax#100
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants