Skip to content
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

Incorrect formatting with """ #110

Closed
renkun-ken opened this issue Dec 7, 2013 · 1 comment
Closed

Incorrect formatting with """ #110

renkun-ken opened this issue Dec 7, 2013 · 1 comment

Comments

@renkun-ken
Copy link

Here the formatter runs perfectly:

module Test

let x = """
Hello, world!
"""
let y = 0
let z = String.length """
Hello, world!
"""
let w = String.length("""
Hello, world!
""")

However, if the code goes like this:

[<EntryPoint>]
let main argv = 
    use fun1 = R.eval(R.parse(text = """
    function(i) {
        x <- rnorm(1000)
        y <- rnorm(1000)
        m <- lm(y~x)
        m$coefficients[[2]]
    }
    """))
    0

The code perfectly complies but if I apply the formatter, the code will incorrectly become

[<EntryPoint>]
let main argv = 
    use fun1 = R.eval(R.parse(text = """
    function(i) {
        x <- rnorm(1000)
        y <- rnorm(1000)
        m <- lm(y~x)
        m$coefficients[[2]]
    }
    """))
))
    0

where the second last line lies two incorrect close braces which causes the code not to compile. I don't know what the problem is. Any ideas?

@dungpa
Copy link
Contributor

dungpa commented Dec 8, 2013

Indeed it is a bug in handling multi-line strings. I logged this bug and the other one as well. Will follow up on the issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants