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

Allow newline between arguments to a call-expression #17

Closed
stasm opened this issue Jan 24, 2017 · 3 comments
Closed

Allow newline between arguments to a call-expression #17

stasm opened this issue Jan 24, 2017 · 3 comments
Assignees
Milestone

Comments

@stasm
Copy link
Contributor

stasm commented Jan 24, 2017

After #2 is fixed, we'll run into a similar problem as the one described in l20n/spec#14, but for arglist: the current grammar doesn't allow new lines in the list of arguments to a call-expression. It makes the complex examples from the syntax guide invalid:

liked-photo = { LEN($people) ->
    [1] { $people } likes
    [2] { $people } like
    [3] { LIST(TAKE(2, $people), "one more person") } like

   *[other] { LIST(
        TAKE(2, $people),
        "{ LEN(DROP(2, $people)) ->
            [1]    one more person like
           *[other]  { LEN(DROP(2, $people)) } more people like
        }"
    ) }
} your photo.
@stasm stasm self-assigned this Jan 24, 2017
@stasm stasm added this to the 0.2 milestone Jan 24, 2017
stasm added a commit to stasm/fluent that referenced this issue Jan 25, 2017
@stasm
Copy link
Contributor Author

stasm commented Jan 26, 2017

@zbraniecki In order to ensure good error recovery, does this has a dependency on #12?

I'm going to move this to the 0.3 milestone which is mostly about making our white-space story well-defined.

@stasm stasm modified the milestones: 0.3, 0.2 Jan 26, 2017
@zbraniecki
Copy link
Collaborator

no, it doesn't depend on #12.

stasm added a commit to stasm/fluent that referenced this issue Feb 15, 2017
Fix projectfluent#12, projectfluent#17, projectfluent#18.

With this change, the entire body of a message needs to indented. This makes
error recovery very easy: finding the next message definition is as simple as
finding the next identifier with no indentation.

It also opens up a number of opportunities: we can remove the `|` syntax for
multiline blocks of text and allow line breaks inside of placeables safely.

The PR also allows the value to be defined on a new line, making the
following examples equivalent:

    lipsum = Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi
        pellentesque congue metus, non mattis sem faucibus sit amet.

    lipsum
        = Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi
        pellentesque congue metus, non mattis sem faucibus sit amet.

I hope this will help when attributes are present:

    lipsum
        = Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi
        pellentesque congue metus, non mattis sem faucibus sit amet.

        .attr = Attribute

Lastly, quoted patterns are only available inside of placeables and cannot be
used directly as values.

The exact semantics of \ escapes will be defined in projectfluent#22.
@stasm stasm added the syntax label Feb 16, 2017
stasm added a commit to stasm/fluent that referenced this issue Feb 24, 2017
Fix projectfluent#12, projectfluent#17, projectfluent#18.

With this change, the entire body of a message must be indented. This makes
error recovery very easy: finding the next message definition is as simple as
finding the next identifier with no indentation.

It also opens up a number of opportunities: we can remove the `|` syntax for
multiline blocks of text and allow line breaks inside of placeables safely.

The change also allows the value to be defined on a new line, making the
following examples equivalent:

    lipsum = Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi
        pellentesque congue metus, non mattis sem faucibus sit amet.

    lipsum =
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi
        pellentesque congue metus, non mattis sem faucibus sit amet.

Lastly, quoted patterns are only available inside of placeables, cannot contain
aother placeables and cannot be used directly as values.

The exact semantics of \ escapes will be defined in projectfluent#22.
stasm added a commit that referenced this issue Feb 24, 2017
Fix #12, #17, #18.

With this change, the entire body of a message must be indented. This makes
error recovery very easy: finding the next message definition is as simple as
finding the next identifier with no indentation.

It also opens up a number of opportunities: we can remove the `|` syntax for
multiline blocks of text and allow line breaks inside of placeables safely.

The change also allows the value to be defined on a new line, making the
following examples equivalent:

    lipsum = Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi
        pellentesque congue metus, non mattis sem faucibus sit amet.

    lipsum =
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi
        pellentesque congue metus, non mattis sem faucibus sit amet.

Lastly, quoted patterns are only available inside of placeables, cannot contain
aother placeables and cannot be used directly as values.

The exact semantics of \ escapes will be defined in #22.
@stasm
Copy link
Contributor Author

stasm commented Feb 24, 2017

This was fixed by #32.

@stasm stasm closed this as completed Feb 24, 2017
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

No branches or pull requests

2 participants