Skip to content

Commit a8c3ee3

Browse files
authored
Merge pull request #1029 from Patternslib/depends-fixes-2.x
Depends fixes 2.x
2 parents 94f10ed + 1a275b8 commit a8c3ee3

File tree

5 files changed

+788
-1737
lines changed

5 files changed

+788
-1737
lines changed

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@ build:: bundle
6464
bundle bundle.js: $(GENERATED) $(SOURCES) build.js stamp-bower
6565
node_modules/.bin/r.js -o build.js
6666

67-
src/lib/depends_parse.js: src/lib/depends_parse.pegjs stamp-npm
68-
$(PEGJS) $<
67+
.PHONY: depends-parser
68+
depends-parser: stamp-npm
69+
$(PEGJS) -O size -f commonjs src/lib/depends_parse.pegjs
6970
sed -i~ -e '1s/.*/define(function() {/' -e '$$s/()//' $@ || rm -f $@
7071

7172
clean::

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"generator-patternslib": "0.2.1",
2020
"http-server": "^0.7.5",
2121
"jshint": "~2.9.3",
22-
"pegjs": "0.7.0",
22+
"pegjs": "0.11.0-master.b7b87ea",
2323
"phantom-jasmine": "0.1.8",
2424
"phantomjs": "^1.9.18",
2525
"requirejs": "",

src/lib/depends_parse.js

Lines changed: 773 additions & 1731 deletions
Large diffs are not rendered by default.

src/lib/depends_parse.pegjs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,10 @@ simple_expression
4646
}
4747

4848
equal_comparison "comparison operator"
49-
= "="
49+
= "=~"
5050
/ "!="
5151
/ "~="
52+
/ "="
5253

5354
order_comparison "comparison operator"
5455
= "<="
@@ -75,9 +76,9 @@ number "number"
7576
}
7677

7778
_
78-
= (WhiteSpace)+
79+
= (WhiteSpace)+
7980

80-
__
81+
__
8182
= (WhiteSpace)*
8283

8384
SourceCharacter
@@ -94,6 +95,7 @@ IdentifierPart
9495
/ "_"
9596
/ "-"
9697
/ "."
98+
/ ":"
9799
/ UnicodeCombiningMark
98100
/ UnicodeDigit
99101
/ UnicodeConnectorPunctuation

tests/specs/lib/depends_parse.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@ define(["pat-depends_parse"], function(parser) {
7070
input: "foo-bar"});
7171
});
7272

73+
it("Colons in name", function () {
74+
var ast = parser.parse("foo:bar");
75+
expect(ast).toEqual({type: "truthy",
76+
input: "foo:bar"});
77+
});
78+
7379
it("Single quoted value", function() {
7480
var ast = parser.parse("foo='bar buz'");
7581
expect(ast).toEqual({type: "comparison",

0 commit comments

Comments
 (0)