X Tutup
Skip to content

fix: corrected var/# parsing in template#2084

Closed
mhevery wants to merge 3 commits intoangular:masterfrom
mhevery:vars
Closed

fix: corrected var/# parsing in template#2084
mhevery wants to merge 3 commits intoangular:masterfrom
mhevery:vars

Conversation

@mhevery
Copy link
Copy Markdown
Contributor

@mhevery mhevery commented May 22, 2015

No description provided.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't this work by only removing the enclosing if (!EOF) { ...}

might need to add an !EOF in the else if

      var name = '\$implicit';
      var expression = null;
      if (keyIsVar) {
        if (this.optionalOperator("=")) {
          name = this.expectTemplateBindingKey();
        }
      } else if (this.next !== EOF && !this.peekKeywordVar()) {
        var start = this.inputIndex;
        var ast = this.parsePipe();
        var source = this.input.substring(start, this.inputIndex);
        expression = new ASTWithSource(ast, source, this.location);
      }

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, implemented

@vicb vicb added @lgtm action: merge The PR is ready for merge by the caretaker action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews labels May 22, 2015
@vicb
Copy link
Copy Markdown
Contributor

vicb commented May 22, 2015

You need to run clang-format

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be #a; #b

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@vicb
Copy link
Copy Markdown
Contributor

vicb commented May 22, 2015

@mhevery Why does the parser needs to explicitly set '\$implicit' ?

  • It doesn't look like a job for a parser - the consumer could interpret null as he likes,
  • Not sure to understand what issue this solves.

@mhevery
Copy link
Copy Markdown
Contributor Author

mhevery commented May 23, 2015

The issues is that var x; parses correctly, but 'var x does not.

Who should set $implicit is a good question, but the previous code had it this way, so I did not change it.

@vicb
Copy link
Copy Markdown
Contributor

vicb commented May 26, 2015

LGTM after the duplicated test is updated (see inline comment var -> #)

@tbosch
Copy link
Copy Markdown
Contributor

tbosch commented Jun 1, 2015

@mhevery could you rebase?

@vicb vicb removed the action: merge The PR is ready for merge by the caretaker label Jun 4, 2015
@vicb
Copy link
Copy Markdown
Contributor

vicb commented Jun 4, 2015

removing merge as unit tests need updates

@mhevery mhevery removed their assignment Jun 5, 2015
@mhevery mhevery removed the action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews label Jun 5, 2015
@vicb
Copy link
Copy Markdown
Contributor

vicb commented Jun 5, 2015

LGTM

@vicb vicb added the action: merge The PR is ready for merge by the caretaker label Jun 5, 2015
@mhevery mhevery closed this in a418397 Jun 5, 2015
@mhevery mhevery deleted the vars branch June 16, 2015 23:43
@angular-automatic-lock-bot
Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker cla: yes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

X Tutup