Skip to content

Commit 2453e83

Browse files
committed
Update for 1.6.2 release
1 parent 53c7116 commit 2453e83

File tree

7 files changed

+49
-19
lines changed

7 files changed

+49
-19
lines changed

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
11
# Change Log
22

3+
## [1.6.2](https://github.com/nicklockwood/ShapeScript/releases/tag/1.6.2) (2023-01-16)
4+
5+
- Improved info panel display
6+
- Fixed twisted extrusion offset
7+
- Fixed roundrect detail level (previously 4x higher than intended)
8+
- Fixed incorrect output when intersecting groups of meshes
9+
- Empty scenes are no longer hidden if they contain debug geometry
10+
- Scene now conforms to Equatable protocol
11+
- Fixed misleading error message for excess color arguments
12+
- Fixed spurious forward declaration error for options that shadow global define
13+
- Added automatic casting of hex strings to color (useful for JSON data(
14+
- Made polygon members available on all geometries, not just manually-created meshes
15+
- Excluded source location from Geometry equality comparisons
16+
- Fixed vector member access on tuples containing string elements
17+
- Fixed vector member access on nested numeric tuples
18+
- Fixed color member access on tuples and strings
19+
- Fixed polygon member lookup on meshes
20+
- Fixed handling of blocks with optional children (e.g. polygon)
21+
- Improved symbol lookup performance
22+
- Bumped Euclid to version 0.6.8
23+
324
## [1.6.1](https://github.com/nicklockwood/ShapeScript/releases/tag/1.6.1) (2023-01-02)
425

526
- Added twist option to extrude command

ShapeScript.podspec.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ShapeScript",
3-
"version": "1.6.1",
3+
"version": "1.6.2",
44
"license": {
55
"type": "MIT",
66
"file": "LICENSE.md"
@@ -10,7 +10,7 @@
1010
"authors": "Nick Lockwood",
1111
"source": {
1212
"git": "https://github.com/nicklockwood/ShapeScript.git",
13-
"tag": "1.6.1"
13+
"tag": "1.6.2"
1414
},
1515
"source_files": ["ShapeScript", "LRUCache/Sources", "SVGPath/Sources"],
1616
"requires_arc": true,

ShapeScript.xcodeproj/project.pbxproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,7 +1131,7 @@
11311131
"$(inherited)",
11321132
"@executable_path/../Frameworks",
11331133
);
1134-
MARKETING_VERSION = 1.6.1;
1134+
MARKETING_VERSION = 1.6.2;
11351135
PRODUCT_BUNDLE_IDENTIFIER = com.charcoaldesign.ShapeScriptViewer;
11361136
PRODUCT_MODULE_NAME = Viewer;
11371137
PRODUCT_NAME = "ShapeScript Viewer";
@@ -1159,7 +1159,7 @@
11591159
"$(inherited)",
11601160
"@executable_path/../Frameworks",
11611161
);
1162-
MARKETING_VERSION = 1.6.1;
1162+
MARKETING_VERSION = 1.6.2;
11631163
PRODUCT_BUNDLE_IDENTIFIER = com.charcoaldesign.ShapeScriptViewer;
11641164
PRODUCT_MODULE_NAME = Viewer;
11651165
PRODUCT_NAME = "ShapeScript Viewer";
@@ -1189,7 +1189,7 @@
11891189
"$(inherited)",
11901190
"@executable_path/Frameworks",
11911191
);
1192-
MARKETING_VERSION = 1.6.1;
1192+
MARKETING_VERSION = 1.6.2;
11931193
PRODUCT_BUNDLE_IDENTIFIER = com.charcoaldesign.ShapeScriptViewer;
11941194
PRODUCT_MODULE_NAME = Viewer;
11951195
PRODUCT_NAME = ShapeScript;
@@ -1221,7 +1221,7 @@
12211221
"$(inherited)",
12221222
"@executable_path/Frameworks",
12231223
);
1224-
MARKETING_VERSION = 1.6.1;
1224+
MARKETING_VERSION = 1.6.2;
12251225
PRODUCT_BUNDLE_IDENTIFIER = com.charcoaldesign.ShapeScriptViewer;
12261226
PRODUCT_MODULE_NAME = Viewer;
12271227
PRODUCT_NAME = ShapeScript;
@@ -1384,7 +1384,7 @@
13841384
"@executable_path/../Frameworks",
13851385
"@loader_path/Frameworks",
13861386
);
1387-
MARKETING_VERSION = 1.6.1;
1387+
MARKETING_VERSION = 1.6.2;
13881388
PRODUCT_BUNDLE_IDENTIFIER = com.charcoaldesign.ShapeScriptLib;
13891389
PRODUCT_NAME = ShapeScript;
13901390
SKIP_INSTALL = YES;
@@ -1415,7 +1415,7 @@
14151415
"@executable_path/../Frameworks",
14161416
"@loader_path/Frameworks",
14171417
);
1418-
MARKETING_VERSION = 1.6.1;
1418+
MARKETING_VERSION = 1.6.2;
14191419
PRODUCT_BUNDLE_IDENTIFIER = com.charcoaldesign.ShapeScriptLib;
14201420
PRODUCT_NAME = ShapeScript;
14211421
SKIP_INSTALL = YES;

ShapeScript/Interpreter.swift

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import Foundation
1111

1212
// MARK: Public interface
1313

14-
public let version = "1.6.1"
14+
public let version = "1.6.2"
1515

1616
public protocol EvaluationDelegate: AnyObject {
1717
func resolveURL(for path: String) -> URL
@@ -491,7 +491,7 @@ extension RuntimeErrorType {
491491
}
492492

493493
private extension RuntimeError {
494-
static let alternatives = [
494+
static let alternatives: [String: [String]] = [
495495
"box": ["cube"],
496496
"rect": ["square"],
497497
"rectangle": ["square"],
@@ -525,11 +525,7 @@ private extension RuntimeError {
525525
"head": ["first"],
526526
"tail": ["last", "allButFirst"],
527527
"rest": ["allButFirst"],
528-
"mod": ["%"],
529-
"equals": ["="],
530-
"eq": ["="],
531-
"is": ["="],
532-
]
528+
].merging(ParserError.alternatives.mapValues { [$0] }) { $1 }
533529

534530
static let osName: String = {
535531
#if os(macOS) || targetEnvironment(macCatalyst)

ShapeScript/Lexer.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,9 @@ public extension LexerError {
160160
var suggestion: String? {
161161
switch type {
162162
case let .unexpectedToken(string):
163+
let options = InfixOperator.allCases.map { $0.rawValue }
163164
return Self.alternatives[string.lowercased()] ??
164-
string.bestMatches(in: InfixOperator.allCases.map { $0.rawValue }).first
165+
string.bestMatches(in: options).first
165166
case let .invalidEscapeSequence(string):
166167
return [
167168
"\"\"": "\\\"",
@@ -246,7 +247,7 @@ public extension String {
246247
// MARK: Implementation
247248

248249
private extension LexerError {
249-
static let alternatives = [
250+
static let alternatives: [String: String] = [
250251
"&&": "and",
251252
"&": "and",
252253
"||": "or",

ShapeScript/Parser.swift

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public enum ExpressionType: Equatable {
6363
case color(Color)
6464
case identifier(String)
6565
case block(Identifier, Block)
66-
indirect case tuple([Expression])
66+
case tuple([Expression])
6767
indirect case prefix(PrefixOperator, Expression)
6868
indirect case infix(Expression, InfixOperator, Expression)
6969
indirect case member(Expression, Identifier)
@@ -126,7 +126,9 @@ public extension ParserError {
126126
return nil
127127
}
128128
let options = InfixOperator.allCases.map { $0.rawValue }
129-
return string.bestMatches(in: options).first
129+
130+
return Self.alternatives[string.lowercased()] ??
131+
string.bestMatches(in: options).first
130132
case .unexpectedToken, .custom:
131133
return nil
132134
}
@@ -149,6 +151,15 @@ public extension ParserError {
149151

150152
// MARK: Implementation
151153

154+
extension ParserError {
155+
static let alternatives: [String: String] = [
156+
"mod": "%",
157+
"equals": "=",
158+
"eq": "=",
159+
"is": "=",
160+
]
161+
}
162+
152163
private extension TokenType {
153164
var errorDescription: String {
154165
switch self {

docs/1.6.2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.6.1

0 commit comments

Comments
 (0)