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

bsc.exe on master complains about invalid escape codes in strings while 9.1.4 is fine #473

Closed
rescript-lang/rescript
#5391
@kevinbarabash

Description

@kevinbarabash

The following code:

let a = "This prints \"Hello, world!\""

works fine using the published 9.1.4 version, but produces the following error when running bsc.exe compiled from master:

./darwin/bsc.exe test2.res

  We've found a bug for you!
  test2.res:1:9-39

  1 │ let a = "This prints \"Hello, world!\""
  2 │ 

  Offset: 13, Invalid escape code: "

The same happens with escaped single quotes as well.

This also happens for byte escape codes. The following code:

let a = "\000\000\246\255\247\255\
   \000\001\002\003\004\005"

works fine with 9.1.4, but produces the follow error when running bsc.exe compiled from master:

./darwin/bsc.exe test_bytes.res

  We've found a bug for you!
  test_bytes.res:1:9-2:28

  1 │ let a = "\000\000\246\255\247\255\
  2 │    \000\001\002\003\004\005"
  3 │ 

  Offset: 9, Invalid escape code: 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions