Skip to content

Mixin defintion arguments: whitespace works as delimiter #2824

Closed

Description

@seven-phases-max

I occasionally stepped into this bogus:

.mixin(@a @b) {
    args: @a @b;  
}

x {
    .mixin(x, y);  // OK -> args: x y;
}

I.e. the supposedly invalid mixin definition .mixin(@a @b) is actually interpreted as being equal to .mixin(@a, @b) and .mixin(@a; @b).

Other curious side-effects are:

  • .m(@a @b, @c) -> .m(@a, @b, @c)
  • .m(@a @b; @c) -> .m(@b, @c)
  • .m(@a; @b @c) -> .m(@a, @b, @c)
  • .m(@a; @b, @c) -> .m(@a, @c)
  • .m(@a, @b @c) -> .m(@a, @b, @c)
  • etc.

Activity

  1. matthew-dean commented on Feb 27, 2016

    @matthew-dean
    Member

    Huh. Interesting.

  2. seven-phases-max commented on Feb 27, 2016

    @seven-phases-max
    MemberAuthor

    Yeah, I was just looking for some syntax that could pass the parser to mimic:

    .for-each(@value in @list) {...}

    (or a sort of) and ooops, found it's already a passable syntax :) (the evaluation part within a plugin will be quite tricky since it has to be a pre-evaluation visitor, but that's another story).

  3. added a commit that references this issue on Jul 11, 2018
    d99a1b8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions