-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from nakajima/main
Maybe fix some concurrency warnings
- Loading branch information
Showing
2 changed files
with
64 additions
and
53 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,71 @@ | ||
import Foundation | ||
|
||
public extension TextualIndenter { | ||
static let basicPatterns: [PatternMatcher] = [ | ||
CurrentLinePrefixOutdenter(prefix: "}"), | ||
CurrentLinePrefixOutdenter(prefix: ")"), | ||
CurrentLinePrefixOutdenter(prefix: "]"), | ||
static var basicPatterns: [PatternMatcher] { | ||
[ | ||
CurrentLinePrefixOutdenter(prefix: "}"), | ||
CurrentLinePrefixOutdenter(prefix: ")"), | ||
CurrentLinePrefixOutdenter(prefix: "]"), | ||
|
||
PreceedingLinePrefixIndenter(prefix: "{"), | ||
PreceedingLinePrefixIndenter(prefix: "("), | ||
PreceedingLinePrefixIndenter(prefix: "["), | ||
PreceedingLinePrefixIndenter(prefix: "{"), | ||
PreceedingLinePrefixIndenter(prefix: "("), | ||
PreceedingLinePrefixIndenter(prefix: "["), | ||
|
||
PreceedingLineSuffixIndenter(suffix: "{"), | ||
PreceedingLineSuffixIndenter(suffix: "("), | ||
PreceedingLineSuffixIndenter(suffix: "["), | ||
] | ||
PreceedingLineSuffixIndenter(suffix: "{"), | ||
PreceedingLineSuffixIndenter(suffix: "("), | ||
PreceedingLineSuffixIndenter(suffix: "["), | ||
] | ||
} | ||
} | ||
|
||
public extension TextualIndenter { | ||
/// Specialized indentation patterns for Ruby. | ||
static let rubyPatterns: [PatternMatcher] = [ | ||
CurrentLinePrefixOutdenter(prefix: "else"), | ||
CurrentLinePrefixOutdenter(prefix: "elsif"), | ||
CurrentLinePrefixOutdenter(prefix: "ensure"), | ||
CurrentLinePrefixOutdenter(prefix: "rescue"), | ||
CurrentLinePrefixOutdenter(prefix: "when"), | ||
CurrentLinePrefixOutdenter(prefix: "end"), | ||
static var rubyPatterns: [PatternMatcher] { | ||
[ | ||
CurrentLinePrefixOutdenter(prefix: "else"), | ||
CurrentLinePrefixOutdenter(prefix: "elsif"), | ||
CurrentLinePrefixOutdenter(prefix: "ensure"), | ||
CurrentLinePrefixOutdenter(prefix: "rescue"), | ||
CurrentLinePrefixOutdenter(prefix: "when"), | ||
CurrentLinePrefixOutdenter(prefix: "end"), | ||
|
||
PreceedingLinePrefixIndenter(prefix: "{"), | ||
PreceedingLinePrefixIndenter(prefix: "("), | ||
PreceedingLinePrefixIndenter(prefix: "["), | ||
PreceedingLinePrefixIndenter(prefix: "{"), | ||
PreceedingLinePrefixIndenter(prefix: "("), | ||
PreceedingLinePrefixIndenter(prefix: "["), | ||
|
||
PreceedingLineSuffixIndenter(suffix: "{"), | ||
PreceedingLineSuffixIndenter(suffix: "("), | ||
PreceedingLineSuffixIndenter(suffix: "["), | ||
PreceedingLineSuffixIndenter(suffix: "|"), | ||
PreceedingLineSuffixIndenter(suffix: "do"), | ||
PreceedingLineSuffixIndenter(suffix: "{"), | ||
PreceedingLineSuffixIndenter(suffix: "("), | ||
PreceedingLineSuffixIndenter(suffix: "["), | ||
PreceedingLineSuffixIndenter(suffix: "|"), | ||
PreceedingLineSuffixIndenter(suffix: "do"), | ||
|
||
PreceedingLinePrefixIndenter(prefix: "if"), | ||
PreceedingLinePrefixIndenter(prefix: "else"), | ||
PreceedingLinePrefixIndenter(prefix: "elsif"), | ||
PreceedingLinePrefixIndenter(prefix: "ensure"), | ||
PreceedingLinePrefixIndenter(prefix: "rescue"), | ||
PreceedingLinePrefixIndenter(prefix: "when"), | ||
PreceedingLinePrefixIndenter(prefix: "for"), | ||
PreceedingLinePrefixIndenter(prefix: "unless"), | ||
PreceedingLinePrefixIndenter(prefix: "while"), | ||
PreceedingLinePrefixIndenter(prefix: "class"), | ||
PreceedingLinePrefixIndenter(prefix: "module"), | ||
PreceedingLinePrefixIndenter(prefix: "def"), | ||
] | ||
PreceedingLinePrefixIndenter(prefix: "if"), | ||
PreceedingLinePrefixIndenter(prefix: "else"), | ||
PreceedingLinePrefixIndenter(prefix: "elsif"), | ||
PreceedingLinePrefixIndenter(prefix: "ensure"), | ||
PreceedingLinePrefixIndenter(prefix: "rescue"), | ||
PreceedingLinePrefixIndenter(prefix: "when"), | ||
PreceedingLinePrefixIndenter(prefix: "for"), | ||
PreceedingLinePrefixIndenter(prefix: "unless"), | ||
PreceedingLinePrefixIndenter(prefix: "while"), | ||
PreceedingLinePrefixIndenter(prefix: "class"), | ||
PreceedingLinePrefixIndenter(prefix: "module"), | ||
PreceedingLinePrefixIndenter(prefix: "def"), | ||
] | ||
} | ||
|
||
/// Specialized indentation patterns for Python. | ||
static let pythonPatterns: [PatternMatcher] = [ | ||
PreceedingLineSuffixIndenter(suffix: ":"), | ||
static var pythonPatterns: [PatternMatcher] { | ||
[ | ||
PreceedingLineSuffixIndenter(suffix: ":"), | ||
|
||
PreceedingLinePrefixIndenter(prefix: "{"), | ||
PreceedingLinePrefixIndenter(prefix: "("), | ||
PreceedingLinePrefixIndenter(prefix: "["), | ||
PreceedingLinePrefixIndenter(prefix: "{"), | ||
PreceedingLinePrefixIndenter(prefix: "("), | ||
PreceedingLinePrefixIndenter(prefix: "["), | ||
|
||
PreceedingLineSuffixIndenter(suffix: "{"), | ||
PreceedingLineSuffixIndenter(suffix: "("), | ||
PreceedingLineSuffixIndenter(suffix: "["), | ||
] | ||
PreceedingLineSuffixIndenter(suffix: "{"), | ||
PreceedingLineSuffixIndenter(suffix: "("), | ||
PreceedingLineSuffixIndenter(suffix: "["), | ||
] | ||
} | ||
} |
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