Skip to content

Commit

Permalink
Fix exyte#380: Parse negative numbers without leading space symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
f3dm76 committed May 30, 2018
1 parent 5ea9312 commit 4e42c0f
Show file tree
Hide file tree
Showing 6 changed files with 323 additions and 8 deletions.
8 changes: 8 additions & 0 deletions Macaw.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,8 @@
5B37139A20BE95D7004BB6EE /* pservers-grad-02-b-manual.svg in Resources */ = {isa = PBXBuildFile; fileRef = 5B37139420BE95D6004BB6EE /* pservers-grad-02-b-manual.svg */; };
5B37139B20BE95D7004BB6EE /* pservers-grad-07-b-manual.svg in Resources */ = {isa = PBXBuildFile; fileRef = 5B37139520BE95D7004BB6EE /* pservers-grad-07-b-manual.svg */; };
5B37139C20BE95D7004BB6EE /* pservers-grad-01-b-manual.reference in Resources */ = {isa = PBXBuildFile; fileRef = 5B37139620BE95D7004BB6EE /* pservers-grad-01-b-manual.reference */; };
5B3713A320BE9D8A004BB6EE /* shapes-grammar-01-f-manual.reference in Resources */ = {isa = PBXBuildFile; fileRef = 5B3713A120BE9D89004BB6EE /* shapes-grammar-01-f-manual.reference */; };
5B3713A420BE9D8A004BB6EE /* shapes-grammar-01-f-manual.svg in Resources */ = {isa = PBXBuildFile; fileRef = 5B3713A220BE9D8A004BB6EE /* shapes-grammar-01-f-manual.svg */; };
5B6E192120AC58F900454E7E /* AlphaEffect.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B6E190F20AC58F700454E7E /* AlphaEffect.swift */; };
5B6E192220AC58F900454E7E /* AlphaEffect.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B6E190F20AC58F700454E7E /* AlphaEffect.swift */; };
5B6E192320AC58F900454E7E /* OffsetEffect.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B6E191020AC58F700454E7E /* OffsetEffect.swift */; };
Expand Down Expand Up @@ -822,6 +824,8 @@
5B37139420BE95D6004BB6EE /* pservers-grad-02-b-manual.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "pservers-grad-02-b-manual.svg"; sourceTree = "<group>"; };
5B37139520BE95D7004BB6EE /* pservers-grad-07-b-manual.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "pservers-grad-07-b-manual.svg"; sourceTree = "<group>"; };
5B37139620BE95D7004BB6EE /* pservers-grad-01-b-manual.reference */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "pservers-grad-01-b-manual.reference"; sourceTree = "<group>"; };
5B3713A120BE9D89004BB6EE /* shapes-grammar-01-f-manual.reference */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "shapes-grammar-01-f-manual.reference"; sourceTree = "<group>"; };
5B3713A220BE9D8A004BB6EE /* shapes-grammar-01-f-manual.svg */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "shapes-grammar-01-f-manual.svg"; sourceTree = "<group>"; };
5B6E190F20AC58F700454E7E /* AlphaEffect.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AlphaEffect.swift; sourceTree = "<group>"; };
5B6E191020AC58F700454E7E /* OffsetEffect.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OffsetEffect.swift; sourceTree = "<group>"; };
5B6E191120AC58F700454E7E /* GaussianBlur.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GaussianBlur.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1439,6 +1443,8 @@
5B1AE20620B6A669007EECCB /* shapes-ellipse-02-t-manual.svg */,
5B1AE1E720B6A669007EECCB /* shapes-ellipse-03-f-manual.reference */,
5B1AE1C120B6A669007EECCB /* shapes-ellipse-03-f-manual.svg */,
5B3713A120BE9D89004BB6EE /* shapes-grammar-01-f-manual.reference */,
5B3713A220BE9D8A004BB6EE /* shapes-grammar-01-f-manual.svg */,
5B1AE1DB20B6A669007EECCB /* shapes-intro-01-t-manual.reference */,
5B1AE1AE20B6A669007EECCB /* shapes-intro-01-t-manual.svg */,
5B1AE1ED20B6A669007EECCB /* shapes-line-01-t-manual.reference */,
Expand Down Expand Up @@ -1693,6 +1699,7 @@
5BAEA9C9206CEAA20049AAAE /* viewBox.svg in Resources */,
5B1AE2DA20B6A669007EECCB /* color-prop-02-f-manual.reference in Resources */,
5B1AE26620B6A669007EECCB /* painting-fill-04-t-manual.svg in Resources */,
5B3713A420BE9D8A004BB6EE /* shapes-grammar-01-f-manual.svg in Resources */,
5B1AE26C20B6A669007EECCB /* painting-fill-05-b-manual.svg in Resources */,
5B37139920BE95D7004BB6EE /* pservers-grad-02-b-manual.reference in Resources */,
5B1AE2D620B6A669007EECCB /* coords-trans-03-t-manual.svg in Resources */,
Expand Down Expand Up @@ -1862,6 +1869,7 @@
5B1AE2CC20B6A669007EECCB /* text-fonts-01-t-manual.reference in Resources */,
5B1AE2D220B6A669007EECCB /* struct-group-01-t-manual.svg in Resources */,
5B1AE2B520B6A669007EECCB /* coords-trans-09-t-manual.reference in Resources */,
5B3713A320BE9D8A004BB6EE /* shapes-grammar-01-f-manual.reference in Resources */,
57CAB1321D7832E000FD8E47 /* polygon.svg in Resources */,
5BAE203A208E163D006BF277 /* rect.reference in Resources */,
5BAE2044208E163D006BF277 /* style.reference in Resources */,
Expand Down
3 changes: 3 additions & 0 deletions MacawTests/MacawSVGTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -559,5 +559,8 @@ class MacawSVGTests: XCTestCase {

func testPserversGrad07() {
validateJSON("pservers-grad-07-b-manual")

func testShapesGrammar01() {
validateJSON("shapes-grammar-01-f-manual")
}
}
14 changes: 7 additions & 7 deletions MacawTests/w3c-test-suite.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ There are 521 SVG tests in total. 212 files uses features that are not covered b
* [switch/object](https://www.w3.org/TR/SVG11/backward.html) (7)

The rest 309 tests can be split into following categories:
* 29.4% passed (91)
* 19% not yet covered (59)
* 29.7% passed (92)
* 18.4% not yet covered (57)
* 14% filters (43)
* 7.8% images (24)
* 2.6% markers (8)
* 19.7% text (61)
* 7.4% blocked by issues (23)
* 7.7% blocked by issues (24)

Status of each test:

Expand Down Expand Up @@ -188,13 +188,13 @@ Status of each test:
|[paths-data-18-f-manual](w3cSVGTests/paths-data-18-f-manual.svg) ||
|[paths-data-19-f-manual](w3cSVGTests/paths-data-19-f-manual.svg) ||
|[paths-data-20-f-manual](w3cSVGTests/paths-data-20-f-manual.svg) ||
|[pservers-grad-01-b-manual](w3cSVGTests/pservers-grad-01-b-manual.svg) | |
|[pservers-grad-02-b-manual](w3cSVGTests/pservers-grad-02-b-manual.svg) | |
|[pservers-grad-01-b-manual](w3cSVGTests/pservers-grad-01-b-manual.svg) | |
|[pservers-grad-02-b-manual](w3cSVGTests/pservers-grad-02-b-manual.svg) | |
|[pservers-grad-03-b-manual](w3cSVGTests/pservers-grad-03-b-manual.svg) ||
|[pservers-grad-04-b-manual](w3cSVGTests/pservers-grad-04-b-manual.svg) ||
|[pservers-grad-05-b-manual](w3cSVGTests/pservers-grad-05-b-manual.svg) ||
|[pservers-grad-06-b-manual](w3cSVGTests/pservers-grad-06-b-manual.svg) ||
|[pservers-grad-07-b-manual](w3cSVGTests/pservers-grad-07-b-manual.svg) | |
|[pservers-grad-07-b-manual](w3cSVGTests/pservers-grad-07-b-manual.svg) | |
|[pservers-grad-08-b-manual](w3cSVGTests/pservers-grad-08-b-manual.svg) ||
|[pservers-grad-09-b-manual](w3cSVGTests/pservers-grad-09-b-manual.svg) ||
|[pservers-grad-10-b-manual](w3cSVGTests/pservers-grad-10-b-manual.svg) ||
Expand Down Expand Up @@ -231,7 +231,7 @@ Status of each test:
|[shapes-ellipse-01-t-manual](w3cSVGTests/shapes-ellipse-01-t-manual.svg) ||
|[shapes-ellipse-02-t-manual](w3cSVGTests/shapes-ellipse-02-t-manual.svg) ||
|[shapes-ellipse-03-f-manual](w3cSVGTests/shapes-ellipse-03-f-manual.svg) ||
|[shapes-grammar-01-f-manual](w3cSVGTests/shapes-grammar-01-f-manual.svg) | |
|[shapes-grammar-01-f-manual](w3cSVGTests/shapes-grammar-01-f-manual.svg) | |
|[shapes-intro-01-t-manual](w3cSVGTests/shapes-intro-01-t-manual.svg) ||
|[shapes-intro-02-f-manual](w3cSVGTests/shapes-intro-02-f-manual.svg) ||
|[shapes-line-01-t-manual](w3cSVGTests/shapes-line-01-t-manual.svg) ||
Expand Down
233 changes: 233 additions & 0 deletions MacawTests/w3cSVGTests/shapes-grammar-01-f-manual.reference
Original file line number Diff line number Diff line change
@@ -0,0 +1,233 @@
{
"layout" : {
"yAligningMode" : "mid",
"scalingMode" : "meet",
"svgSize" : {
"height" : "100.0%",
"width" : "100.0%"
},
"xAligningMode" : "mid",
"viewBox" : {
"x" : 0,
"w" : 480,
"type" : "Rect",
"y" : 0,
"h" : 360
}
},
"contents" : [
{
"contents" : [
{
"place" : "1, 0, 0, 1, 0, 400",
"contents" : [
{
"contents" : [
{
"fill" : {
"type" : "Color",
"val" : 3381606
},
"form" : {
"type" : "Polyline",
"points" : [
270,
-225,
300,
-245,
320,
-225,
340,
-245,
280,
-280,
390,
-280,
420,
-240,
280,
-185
]
},
"node" : "Shape",
"stroke" : {
"join" : "miter",
"cap" : "butt",
"fill" : {
"type" : "Color",
"val" : 30464
},
"dashes" : [

],
"width" : 8
}
},
{
"fill" : {
"type" : "Color",
"val" : 5635993
},
"form" : {
"type" : "Polygon",
"points" : [
179,
-185,
218,
-203,
228,
-245,
202,
-279,
159,
-280,
131,
-247,
139,
-205
]
},
"node" : "Shape",
"stroke" : {
"join" : "miter",
"cap" : "butt",
"fill" : {
"type" : "Color",
"val" : 30464
},
"dashes" : [

],
"width" : 8
}
}
],
"node" : "Group"
},
{
"contents" : [
{
"stroke" : {
"join" : "miter",
"cap" : "butt",
"fill" : {
"type" : "Color",
"val" : 3394662
},
"dashes" : [

],
"width" : 3
},
"form" : {
"type" : "Polyline",
"points" : [
270,
-225,
300,
-245,
320,
-225,
340,
-245,
280,
-280,
390,
-280,
420,
-240,
280,
-185
]
},
"node" : "Shape"
},
{
"stroke" : {
"join" : "miter",
"cap" : "butt",
"fill" : {
"type" : "Color",
"val" : 3394662
},
"dashes" : [

],
"width" : 3
},
"form" : {
"type" : "Polygon",
"points" : [
179,
-185,
218,
-203,
228,
-245,
202,
-279,
159,
-280,
131,
-247,
139,
-205
]
},
"node" : "Shape"
}
],
"node" : "Group"
}
],
"node" : "Group"
}
],
"node" : "Group"
},
{
"contents" : [
{
"baseline" : "bottom",
"fill" : {
"type" : "Color",
"val" : 0
},
"node" : "Text",
"align" : "min",
"text" : "$Revision: 1.2 $",
"place" : "1, 0, 0, 1, 10, 340",
"font" : {
"name" : "SVGFreeSansASCII,sans-serif",
"size" : 32,
"weight" : "normal"
}
}
],
"node" : "Group"
},
{
"stroke" : {
"join" : "miter",
"cap" : "butt",
"fill" : {
"type" : "Color",
"val" : 0
},
"dashes" : [

],
"width" : 1
},
"form" : {
"x" : 1,
"w" : 478,
"type" : "Rect",
"y" : 1,
"h" : 358
},
"node" : "Shape"
}
],
"node" : "Canvas"
}
Loading

0 comments on commit 4e42c0f

Please sign in to comment.