Skip to content

Multi-line strings don't work on Windows #254

@mbartlett21

Description

@mbartlett21
Original error

I recently tried to use a new version of Gren (previously on 0.2.0) and was unuable to get it to compile. As a result I tried just doing a simple project with default dependencies.

My gren.json (created by gren init) is below:

{
    "type": "application",
    "platform": "browser",
    "source-directories": [
        "src"
    ],
    "gren-version": "0.4.4",
    "dependencies": {
        "direct": {
            "gren-lang/browser": "4.0.0",
            "gren-lang/core": "5.0.2"
        },
        "indirect": {
            "gren-lang/url": "4.0.0"
        }
    }
}

and it results in this error:

Dependency problem!
-- PROBLEM BUILDING DEPENDENCIES -----------------------------------------------

I ran into a compilation error when trying to build the following package:

    gren-lang/browser 4.0.0

This probably means it has package constraints that are too wide. It may be
possible to tweak your gren.json to avoid the root problem as a stopgap. Head
over to https://gren-lang.org/community to get help figuring out how to take
this path!

Note: To help with the root problem, please report this to the package author
along with the following information:

    gren-lang/core 5.0.2
    gren-lang/url 4.0.0

If you want to help out even more, try building the package locally. That should
give you much more specific information about why this package is failing to
build, which will in turn make it easier for the package author to fix it!

Actually it looks like the error is that Git on Windows likes changing line endings to \r\n rather than just \n and Gren doesn't like that with multiline strings:

AppData\Local\gren\0.4.4\packages\gren-lang\browser\4.0.0
> gren make
Dependencies ready!
Detected problems in 2 modules.
-- MULTILINE STRING WITHOUT LEADING NEWLINE ---------- src\Debugger\History.gren

The contents of a multiline sting must start on a new line

447|     Html.node "style" [] [ text """
                                     ^
Add a """ a new line right after the opening quotes.

Note: Here is a valid multi-line string for reference:

    """
    # Multi-line Strings

    - start with triple double quotes
    - write whatever you want
    - no need to escape newlines or double quotes
    - end with triple double quotes
    """

                                                         Debugger.History  Γåæ
====o======================================================================o====
    Γåô  Debugger.Overlay


-- MULTILINE STRING WITHOUT LEADING NEWLINE ---------- src\Debugger\Overlay.gren

The contents of a multiline sting must start on a new line

297|     """
         ^
Add a """ a new line right after the opening quotes.

Note: Here is a valid multi-line string for reference:

    """
    # Multi-line Strings

    - start with triple double quotes
    - write whatever you want
    - no need to escape newlines or double quotes
    - end with triple double quotes
    """

My system git has core.autocrlf set to true, but everything else is generally happy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomershelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions