8000 Allow `else if` conditions · Issue #81 · kaj/ructe · GitHub
[go: up one dir, main page]

Skip to content

Allow else if conditions #81

Closed

Description

@Aunmag

Can't compile this simple template:

@()

@if false {
1
} else if false {
2
} else {
3
}

It says:

warning: Template parse error in "templates\\test.rs.html":
warning:    5:} else if false {
warning:                      ^ Error in expression starting here:

If I remove the else if condition, then it will compile.

rustc 1.44.0 (49cae5576 2020-06-01)
cargo 1.44.0 (05d080faa 2020-05-06)
ructe 0.11.4

Activity

  1. kaj commented on Jun 21, 2020

    @kaj
    Owner

    Yes, it would clearly be reasonable to support else if. Do you want to attempt a pull request?

    Until fixed, it should be simple to work around, like so:

    @if false {
      1
    } else {
      @if false {
        2
      } else {
        3
      }
    }
    
  2. Aunmag commented on Jun 23, 2020

    @Aunmag
    Author

    @kaj I'm sorry what do you mean by "attempt a pull request"?

  3. kaj commented on Jun 24, 2020

    @kaj
    Owner

    @kaj I'm sorry what do you mean by "attempt a pull request"?

    To write the code that fixes it and submit it here on github as a pull request. If you don't want to, it up for anyone who want to, or I'll fix it in a few days.

  4. Aunmag commented on Jun 26, 2020

    @Aunmag
    Author

    @kaj I'm not sure if I can handle it. It will take some time, and don't have it much for now. So it would be better if somebody else will fix this.

  5. added a commit that references this issue on Jun 24, 2021
    e88f4ea
  6. kaj commented on Jun 24, 2021

    @kaj
    Owner

    Took quite some time for me to get around to it, but I'm on it now. :-)

  7. added a commit that references this issue on Jun 24, 2021
    7a0dc5a
  8. added 2 commits that reference this issue on Jun 24, 2021
    110e72a
    2f42f15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0