forked from davedelong/DDMathParser
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce the idea of a “Configuration”
The Configuration struct encapsulates all of the options used by a parser. This makes it easier to add new flags in the future without having to modify a zillion different call-sites
- Loading branch information
1 parent
c2e8248
commit 34d4438
Showing
12 changed files
with
120 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// | ||
// Configuration.swift | ||
// MathParser | ||
// | ||
// Created by Dave DeLong on 4/18/19. | ||
// | ||
|
||
import Foundation | ||
|
||
public struct Configuration { | ||
|
||
public static let `default` = Configuration() | ||
|
||
public var operatorSet: OperatorSet | ||
public var locale: Locale? | ||
|
||
public var allowArgumentlessFunctions: Bool | ||
public var allowImplicitMultiplication: Bool | ||
public var useHighPrecedenceImplicitMultiplication: Bool | ||
|
||
public init() { | ||
operatorSet = OperatorSet.default | ||
locale = nil | ||
|
||
allowArgumentlessFunctions = true | ||
allowImplicitMultiplication = true | ||
useHighPrecedenceImplicitMultiplication = true | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.