Skip to content
This repository has been archived by the owner on Feb 22, 2018. It is now read-only.

Issue with the parser and filters #755

Closed
vicb opened this issue Mar 18, 2014 · 1 comment
Closed

Issue with the parser and filters #755

vicb opened this issue Mar 18, 2014 · 1 comment

Comments

@vicb
Copy link
Contributor

vicb commented Mar 18, 2014

@kasperl you're the parser guy, right ? could you please help me with this:

      iit('should call a filter', () {
         expect(eval("'Foo'|uppercase", filters)).toEqual("FOO");
+        expect(eval("'Hello ' + ('Foo'|uppercase)", filters)).toEqual("Hello FOO");
         expect(eval("'fOo'|uppercase|lowercase", filters)).toEqual("foo");
       });

I would expect the added test to work but it fails with

 unittest-suite-wait-for-doneChrome 33.0.1750 (Linux) hybrid getter-setter parse filters should call a filter FAILED
    Test failed: Caught Parser Error: Missing expected ) at column 17 in ['Hello' + ('Foo'|uppercase)]
    #0      DynamicParserImpl.error (package:angular/core/parser/dynamic_parser_impl.dart:336:5)
    #1      DynamicParserImpl.expectCharacter (package:angular/core/parser/dynamic_parser_impl.dart:302:10)
    #2      DynamicParserImpl.parsePrimary (package:angular/core/parser/dynamic_parser_impl.dart:214:22)
    #3      DynamicParserImpl.parseAccessOrCallMember (package:angular/core/parser/dynamic_parser_impl.dart:186:30)
    #4      DynamicParserImpl.parsePrefix (package:angular/core/parser/dynamic_parser_impl.dart:181:37)
    #5      DynamicParserImpl.parseMultiplicative (package:angular/core/parser/dynamic_parser_impl.dart:156:29)
    #6      DynamicParserImpl.parseAdditive (package:angular/core/parser/dynamic_parser_impl.dart:145:67)
    #7      DynamicParserImpl.parseRelational (package:angular/core/parser/dynamic_parser_impl.dart:124:31)
    #8      DynamicParserImpl.parseEquality (package:angular/core/parser/dynamic_parser_impl.dart:110:33)
    #9      DynamicParserImpl.parseLogicalAnd (package:angular/core/parser/dynamic_parser_impl.dart:101:31)
    #10     DynamicParserImpl.parseLogicalOr (package:angular/core/parser/dynamic_parser_impl.dart:92:33)
    #11     DynamicParserImpl.parseConditional (package:angular/core/parser/dynamic_parser_impl.dart:76:32)
    #12     DynamicParserImpl.parseExpression (package:angular/core/parser/dynamic_parser_impl.dart:61:34)
    #13     DynamicParserImpl.parseFilter (package:angular/core/parser/dynamic_parser_impl.dart:46:33)
    #14     DynamicParserImpl.parseChain (package:angular/core/parser/dynamic_parser_impl.dart:31:29)
    #15     DynamicParser._parse (package:angular/core/parser/dynamic_parser.dart:34:46)
    #16     DynamicParser.call.<anonymous closure> (package:angular/core/parser/dynamic_parser.dart:29:50)
    #17     _HashMap.putIfAbsent (dart:collection-patch/collection_patch.dart:124)
    #18     DynamicParser.call (package:angular/core/parser/dynamic_parser.dart:29:30)
    #19     main.<anonymous closure>.eval (/home/victor/dart/angular.dart/test/core/parser/parser_spec.dart:61:18)
    #20     main.<anonymous closure>.<anonymous closure>.<anonymous closure> (/home/victor/dart/angular.dart/test/core/parser/parser_spec.dart:983:20)

I came to this while debugging the parsing of Hello {{ name | json }} ! the generated expression is '"Hello "+( name | json )+" !"' but the AST shows a Chain expression (('Hello '+name)|json);' !' - well I add to remove the parents from the generated expression, it would not parse otherwise.

@vicb
Copy link
Contributor Author

vicb commented Mar 18, 2014

I should have a fix soon

vicb added a commit to vicb/angular.dart that referenced this issue Mar 18, 2014
vicb added a commit to vicb/angular.dart that referenced this issue Mar 19, 2014
vicb added a commit to vicb/angular.dart that referenced this issue Mar 19, 2014
mhevery pushed a commit to mhevery/angular.dart that referenced this issue Mar 20, 2014
vicb added a commit to vicb/angular.dart that referenced this issue Mar 20, 2014
vicb added a commit to vicb/angular.dart that referenced this issue Mar 22, 2014
closes dart-archive#755

Ad support for '"s" + ("m"|filter) + "e"'
@vicb vicb closed this as completed in 25dfd32 Mar 25, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
1 participant