├── Sources
├── TreeSitterLanguages
│ ├── css_parser.c
│ ├── php_parser.c
│ ├── css_scanner.c
│ ├── html_parser.c
│ ├── java_parser.c
│ ├── json_parser.c
│ ├── php_scanner.cc
│ ├── private
│ │ └── tag.h
│ ├── html_scanner.cc
│ ├── java_scanner.c
│ ├── javascript_parser.c
│ └── include
│ │ └── languages.h
└── SwiftTreeSitter
│ ├── SwiftTreeSitter.modulemap
│ ├── STSQueryPredicates.swift
│ ├── STSQueryMatch.swift
│ ├── SwiftTreeSitter.h
│ ├── STSPoint.swift
│ ├── STSQueryCapture.swift
│ ├── Info.plist
│ ├── STSInputEdit.swift
│ ├── STSRange.swift
│ ├── STSTree.swift
│ ├── STSTreeCursor.swift
│ ├── STSQueryCursor.swift
│ ├── STSQuery.swift
│ ├── STSLanguage.swift
│ ├── STSNode.swift
│ └── STSParser.swift
├── .gitignore
├── SwiftTreeSitter.xcodeproj
├── GeneratedModuleMap
│ ├── CTreeSitter
│ │ └── module.modulemap
│ └── TreeSitterLanguages
│ │ └── module.modulemap
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ ├── IDEWorkspaceChecks.plist
│ │ └── WorkspaceSettings.xcsettings
├── CTreeSitter_Info.plist
├── SwiftTreeSitter_Info.plist
├── SwiftTreeSitterTests_Info.plist
├── TreeSitterLanguages_Info.plist
└── xcshareddata
│ └── xcschemes
│ ├── SwiftTreeSitter.xcscheme
│ └── SwiftTreeSitter-Package.xcscheme
├── languages
├── css
│ ├── css.xcodeproj
│ │ ├── project.xcworkspace
│ │ │ ├── contents.xcworkspacedata
│ │ │ └── xcshareddata
│ │ │ │ └── IDEWorkspaceChecks.plist
│ │ └── project.pbxproj
│ └── css
│ │ └── info.plist
├── php
│ ├── php.xcodeproj
│ │ ├── project.xcworkspace
│ │ │ ├── contents.xcworkspacedata
│ │ │ └── xcshareddata
│ │ │ │ └── IDEWorkspaceChecks.plist
│ │ └── project.pbxproj
│ └── php
│ │ └── info.plist
├── html
│ ├── html.xcodeproj
│ │ ├── project.xcworkspace
│ │ │ ├── contents.xcworkspacedata
│ │ │ └── xcshareddata
│ │ │ │ └── IDEWorkspaceChecks.plist
│ │ └── project.pbxproj
│ └── html
│ │ └── info.plist
├── java
│ ├── java.xcodeproj
│ │ ├── project.xcworkspace
│ │ │ ├── contents.xcworkspacedata
│ │ │ └── xcshareddata
│ │ │ │ └── IDEWorkspaceChecks.plist
│ │ └── project.pbxproj
│ └── java
│ │ └── info.plist
├── json
│ ├── json.xcodeproj
│ │ ├── project.xcworkspace
│ │ │ ├── contents.xcworkspacedata
│ │ │ └── xcshareddata
│ │ │ │ └── IDEWorkspaceChecks.plist
│ │ └── project.pbxproj
│ └── json
│ │ └── info.plist
└── javascript
│ ├── javascript.xcodeproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ └── project.pbxproj
│ └── javascript
│ └── info.plist
├── Tests
└── SwiftTreeSitterTests
│ ├── LanguageTests.swift
│ ├── LanguageLoaderTests.swift
│ ├── Info.plist
│ ├── TreeCursorTests.swift
│ ├── QueryCursorTests.swift
│ ├── QueryTests.swift
│ └── ParserTests.swift
├── Package.swift
├── .gitmodules
├── .github
└── workflows
│ └── test.yml
├── LICENSE
├── make-language-bundle.sh
└── README.md
/Sources/TreeSitterLanguages/css_parser.c:
--------------------------------------------------------------------------------
1 | ../../languages/css/tree-sitter-css/src/parser.c
--------------------------------------------------------------------------------
/Sources/TreeSitterLanguages/php_parser.c:
--------------------------------------------------------------------------------
1 | ../../languages/php/tree-sitter-php/src/parser.c
--------------------------------------------------------------------------------
/Sources/TreeSitterLanguages/css_scanner.c:
--------------------------------------------------------------------------------
1 | ../../languages/css/tree-sitter-css/src/scanner.c
--------------------------------------------------------------------------------
/Sources/TreeSitterLanguages/html_parser.c:
--------------------------------------------------------------------------------
1 | ../../languages/html/tree-sitter-html/src/parser.c
--------------------------------------------------------------------------------
/Sources/TreeSitterLanguages/java_parser.c:
--------------------------------------------------------------------------------
1 | ../../languages/java/tree-sitter-java/src/parser.c
--------------------------------------------------------------------------------
/Sources/TreeSitterLanguages/json_parser.c:
--------------------------------------------------------------------------------
1 | ../../languages/json/tree-sitter-json/src/parser.c
--------------------------------------------------------------------------------
/Sources/TreeSitterLanguages/php_scanner.cc:
--------------------------------------------------------------------------------
1 | ../../languages/php/tree-sitter-php/src/scanner.cc
--------------------------------------------------------------------------------
/Sources/TreeSitterLanguages/private/tag.h:
--------------------------------------------------------------------------------
1 | ../../../languages/html/tree-sitter-html/src/tag.h
--------------------------------------------------------------------------------
/Sources/TreeSitterLanguages/html_scanner.cc:
--------------------------------------------------------------------------------
1 | ../../languages/html/tree-sitter-html/src/scanner.cc
--------------------------------------------------------------------------------
/Sources/TreeSitterLanguages/java_scanner.c:
--------------------------------------------------------------------------------
1 | ../../languages/javascript/tree-sitter-javascript/src/scanner.c
--------------------------------------------------------------------------------
/Sources/TreeSitterLanguages/javascript_parser.c:
--------------------------------------------------------------------------------
1 | ../../languages/javascript/tree-sitter-javascript/src/parser.c
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Is build from source
2 | SwiftTreeSitter/libtree-sitter.a
3 |
4 | ## User settings
5 | xcuserdata/
6 |
7 | .DS_Store
8 | .build
--------------------------------------------------------------------------------
/SwiftTreeSitter.xcodeproj/GeneratedModuleMap/CTreeSitter/module.modulemap:
--------------------------------------------------------------------------------
1 | module CTreeSitter {
2 | umbrella "/Users/viktorstrate/Development/xcode/swift-tree-sitter/tree-sitter/lib/include"
3 | export *
4 | }
5 |
--------------------------------------------------------------------------------
/SwiftTreeSitter.xcodeproj/GeneratedModuleMap/TreeSitterLanguages/module.modulemap:
--------------------------------------------------------------------------------
1 | module TreeSitterLanguages {
2 | umbrella "/Users/viktorstrate/Development/xcode/swift-tree-sitter/Sources/TreeSitterLanguages/include"
3 | export *
4 | }
5 |
--------------------------------------------------------------------------------
/languages/css/css.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/languages/php/php.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/languages/html/html.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/languages/java/java.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/languages/json/json.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/SwiftTreeSitter.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/languages/javascript/javascript.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Sources/TreeSitterLanguages/include/languages.h:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | TSLanguage *tree_sitter_json();
4 | TSLanguage *tree_sitter_html();
5 | TSLanguage *tree_sitter_css();
6 | TSLanguage *tree_sitter_java();
7 | TSLanguage *tree_sitter_javascript();
8 | TSLanguage *tree_sitter_php();
9 |
--------------------------------------------------------------------------------
/Sources/SwiftTreeSitter/SwiftTreeSitter.modulemap:
--------------------------------------------------------------------------------
1 |
2 | framework module SwiftTreeSitter {
3 | umbrella header "SwiftTreeSitter.h"
4 |
5 | explicit module CTreeSitter {
6 | private header "api.h"
7 | private header "parser.h"
8 | }
9 |
10 | export *
11 | }
12 |
13 |
14 |
--------------------------------------------------------------------------------
/SwiftTreeSitter.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/languages/css/css.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/languages/html/html.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/languages/java/java.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/languages/json/json.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/languages/php/php.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/languages/javascript/javascript.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/SwiftTreeSitter.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Sources/SwiftTreeSitter/STSQueryPredicates.swift:
--------------------------------------------------------------------------------
1 | //
2 | // STSQueryPredicate.swift
3 | // SwiftTreeSitter
4 | //
5 | // Created by Viktor Strate Kløvedal on 02/06/2020.
6 | // Copyright © 2020 viktorstrate. All rights reserved.
7 | //
8 |
9 | #if _XCODE_BUILD_
10 | import SwiftTreeSitter.CTreeSitter
11 | #else
12 | import CTreeSitter
13 | #endif
14 |
15 | public struct STSQueryPredicate {
16 | public let name: String
17 | public let args: [STSQueryPredicateArg]
18 | }
19 |
20 | public enum STSQueryPredicateArg: Equatable, Hashable {
21 | case capture(uint)
22 | case string(String)
23 | }
24 |
--------------------------------------------------------------------------------
/Sources/SwiftTreeSitter/STSQueryMatch.swift:
--------------------------------------------------------------------------------
1 | //
2 | // STSQueryMatch.swift
3 | // SwiftTreeSitter
4 | //
5 | // Created by Viktor Strate Kløvedal on 26/05/2020.
6 | // Copyright © 2020 viktorstrate. All rights reserved.
7 | //
8 |
9 | #if _XCODE_BUILD_
10 | import SwiftTreeSitter.CTreeSitter
11 | #else
12 | import CTreeSitter
13 | #endif
14 |
15 | public struct STSQueryMatch: Equatable, Hashable {
16 | public let id: uint
17 | public let index: uint
18 | public let captures: [STSQueryCapture]
19 |
20 | public static func == (lhs: STSQueryMatch, rhs: STSQueryMatch) -> Bool {
21 | return lhs.id == rhs.id
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Sources/SwiftTreeSitter/SwiftTreeSitter.h:
--------------------------------------------------------------------------------
1 | //
2 | // SwiftTreeSitter.h
3 | // SwiftTreeSitter
4 | //
5 | // Created by Viktor Strate Kløvedal on 23/05/2020.
6 | // Copyright © 2020 viktorstrate. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | //! Project version number for SwiftTreeSitter.
12 | FOUNDATION_EXPORT double SwiftTreeSitterVersionNumber;
13 |
14 | //! Project version string for SwiftTreeSitter.
15 | FOUNDATION_EXPORT const unsigned char SwiftTreeSitterVersionString[];
16 |
17 | // In this header, you should import all the public headers of your framework using statements like #import
18 |
--------------------------------------------------------------------------------
/Tests/SwiftTreeSitterTests/LanguageTests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // LanguageTests.swift
3 | // SwiftTreeSitterTests
4 | //
5 | // Created by Viktor Strate Kløvedal on 24/05/2020.
6 | // Copyright © 2020 viktorstrate. All rights reserved.
7 | //
8 |
9 | import XCTest
10 | @testable import SwiftTreeSitter
11 |
12 | class LanguageTests: XCTestCase {
13 |
14 | var language: STSLanguage!
15 |
16 | override func setUpWithError() throws {
17 | language = try STSLanguage(fromPreBundle: .json)
18 | }
19 |
20 | func testLanguageAuxillaryFunctions() throws {
21 | let _ = language.fieldCount
22 | let _ = language.symbolCount
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/languages/json/json/info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | STSLoadFunction
6 | tree_sitter_json
7 | TreeSitter
8 |
9 |
10 |
11 |
12 | CFBundleExecutable
13 | json
14 | CFBundleIdentifier
15 | io.github.viktorstrate.SwiftTreeSitter.language.json
16 | CFBundleName
17 | json
18 | CFBundleShortVersionString
19 | 0.16.0
20 | CFBundleSupportedPlatforms
21 |
22 | MacOSX
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Tests/SwiftTreeSitterTests/LanguageLoaderTests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // LanguageLoaderTests.swift
3 | // SwiftTreeSitterTests
4 | //
5 | // Created by Viktor Strate Kløvedal on 24/05/2020.
6 | // Copyright © 2020 viktorstrate. All rights reserved.
7 | //
8 |
9 | import XCTest
10 | @testable import SwiftTreeSitter
11 |
12 | class LanguageLoaderTests: XCTestCase {
13 |
14 | func testLoadLanguages() throws {
15 | let _ = try STSLanguage(fromPreBundle: .css)
16 | let _ = try STSLanguage(fromPreBundle: .html)
17 | let _ = try STSLanguage(fromPreBundle: .java)
18 | let _ = try STSLanguage(fromPreBundle: .javascript)
19 | let _ = try STSLanguage(fromPreBundle: .json)
20 | let _ = try STSLanguage(fromPreBundle: .php)
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/Tests/SwiftTreeSitterTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE)
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/Sources/SwiftTreeSitter/STSPoint.swift:
--------------------------------------------------------------------------------
1 | //
2 | // STSPoint.swift
3 | // SwiftTreeSitter
4 | //
5 | // Created by Viktor Strate Kløvedal on 26/05/2020.
6 | // Copyright © 2020 viktorstrate. All rights reserved.
7 | //
8 |
9 | #if _XCODE_BUILD_
10 | import SwiftTreeSitter.CTreeSitter
11 | #else
12 | import CTreeSitter
13 | #endif
14 |
15 | public struct STSPoint: Equatable, Hashable {
16 | public let row: uint
17 | public let column: uint
18 |
19 | internal var tsPoint: TSPoint {
20 | get {
21 | TSPoint(row: row, column: column)
22 | }
23 | }
24 |
25 | public init(row: uint, column: uint) {
26 | self.row = row
27 | self.column = column
28 | }
29 |
30 | internal init(from tsPoint: TSPoint) {
31 | self.init(row: tsPoint.row, column: tsPoint.column)
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/Sources/SwiftTreeSitter/STSQueryCapture.swift:
--------------------------------------------------------------------------------
1 | //
2 | // STSQueryCapture.swift
3 | // SwiftTreeSitter
4 | //
5 | // Created by Viktor Strate Kløvedal on 26/05/2020.
6 | // Copyright © 2020 viktorstrate. All rights reserved.
7 | //
8 |
9 | #if _XCODE_BUILD_
10 | import SwiftTreeSitter.CTreeSitter
11 | #else
12 | import CTreeSitter
13 | #endif
14 |
15 | public struct STSQueryCapture: Equatable, Hashable {
16 | public let node: STSNode
17 | public let index: uint
18 |
19 | internal let query: STSQuery
20 |
21 | internal init(query: STSQuery, node: STSNode, index: uint) {
22 | self.query = query
23 | self.node = node
24 | self.index = index
25 | }
26 |
27 | public var name: String {
28 | get {
29 | query.captureName(forId: self.index)
30 | }
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/SwiftTreeSitter.xcodeproj/CTreeSitter_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/SwiftTreeSitter.xcodeproj/SwiftTreeSitter_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/SwiftTreeSitter.xcodeproj/SwiftTreeSitterTests_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | BNDL
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/SwiftTreeSitter.xcodeproj/TreeSitterLanguages_Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CFBundleDevelopmentRegion
5 | en
6 | CFBundleExecutable
7 | $(EXECUTABLE_NAME)
8 | CFBundleIdentifier
9 | $(PRODUCT_BUNDLE_IDENTIFIER)
10 | CFBundleInfoDictionaryVersion
11 | 6.0
12 | CFBundleName
13 | $(PRODUCT_NAME)
14 | CFBundlePackageType
15 | FMWK
16 | CFBundleShortVersionString
17 | 1.0
18 | CFBundleSignature
19 | ????
20 | CFBundleVersion
21 | $(CURRENT_PROJECT_VERSION)
22 | NSPrincipalClass
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Package.swift:
--------------------------------------------------------------------------------
1 | // swift-tools-version:5.1
2 | import PackageDescription
3 |
4 | let package = Package(
5 | name: "SwiftTreeSitter",
6 | products: [
7 | .library(name: "SwiftTreeSitter", targets: ["SwiftTreeSitter"]),
8 | ],
9 | targets: [
10 | .target(name: "SwiftTreeSitter", dependencies: ["CTreeSitter", "TreeSitterLanguages"]),
11 | .target(
12 | name: "TreeSitterLanguages",
13 | dependencies: ["CTreeSitter"],
14 | cSettings: [
15 | .headerSearchPath("private")
16 | ]
17 | ),
18 | .target(
19 | name: "CTreeSitter",
20 | path: "tree-sitter/lib",
21 | sources: ["src/lib.c"],
22 | cSettings: [
23 | .headerSearchPath("src")
24 | ]
25 | ),
26 | .testTarget(
27 | name: "SwiftTreeSitterTests",
28 | dependencies: ["SwiftTreeSitter", "TreeSitterLanguages"]
29 | ),
30 | ]
31 | )
32 |
--------------------------------------------------------------------------------
/languages/css/css/info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | STSLoadFunction
6 | tree_sitter_css
7 | TreeSitter
8 |
9 | Scope
10 | source.css
11 | Filetypes
12 |
13 | css
14 |
15 | FirstLineRegex
16 |
17 | ContentRegex
18 |
19 | InjectionRegex
20 | ^css$
21 |
22 | CFBundleExecutable
23 | css
24 | CFBundleIdentifier
25 | io.github.viktorstrate.SwiftTreeSitter.language.css
26 | CFBundleName
27 | css
28 |
29 |
30 |
--------------------------------------------------------------------------------
/languages/java/java/info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | STSLoadFunction
6 | tree_sitter_java
7 | TreeSitter
8 |
9 | Scope
10 | source.java
11 | Filetypes
12 |
13 | java
14 |
15 | Highlights
16 |
17 |
18 | CFBundleExecutable
19 | java
20 | CFBundleIdentifier
21 | io.github.viktorstrate.SwiftTreeSitter.language.java
22 | CFBundleName
23 | java
24 | CFBundleShortVersionString
25 | 0.16.0
26 | CFBundleSupportedPlatforms
27 |
28 | MacOSX
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/Sources/SwiftTreeSitter/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE)
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | $(CURRENT_PROJECT_VERSION)
21 | NSHumanReadableCopyright
22 | Copyright © 2020 viktorstrate. All rights reserved.
23 |
24 |
25 |
--------------------------------------------------------------------------------
/languages/php/php/info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | STSLoadFunction
6 | tree_sitter_php
7 | TreeSitter
8 |
9 | Scopesource.php
10 | Filetypes
11 | php
12 |
13 | FirstLineRegex
14 | ContentRegex
15 | InjectionRegex
16 |
17 | CFBundleExecutable
18 | php
19 | CFBundleIdentifier
20 | io.github.viktorstrate.SwiftTreeSitter.language.php
21 | CFBundleName
22 | php
23 | CFBundleShortVersionString
24 | 0.16.1
25 | CFBundleSupportedPlatforms
26 |
27 | MacOSX
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/languages/html/html/info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | STSLoadFunction
6 | tree_sitter_html
7 | TreeSitter
8 |
9 | Scopetext.html.basic
10 | Filetypes
11 | html
12 |
13 | FirstLineRegex
14 | ContentRegex
15 | InjectionRegexhtml
16 |
17 | CFBundleExecutable
18 | html
19 | CFBundleIdentifier
20 | io.github.viktorstrate.SwiftTreeSitter.language.html
21 | CFBundleName
22 | html
23 | CFBundleShortVersionString
24 | 0.16.0
25 | CFBundleSupportedPlatforms
26 |
27 | MacOSX
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "tree-sitter"]
2 | path = tree-sitter
3 | url = https://github.com/tree-sitter/tree-sitter.git
4 | [submodule "languages/javascript/tree-sitter-javascript"]
5 | path = languages/javascript/tree-sitter-javascript
6 | url = https://github.com/tree-sitter/tree-sitter-javascript.git
7 | [submodule "languages/css/tree-sitter-css"]
8 | path = languages/css/tree-sitter-css
9 | url = https://github.com/tree-sitter/tree-sitter-css.git
10 | [submodule "languages/html/tree-sitter-html"]
11 | path = languages/html/tree-sitter-html
12 | url = https://github.com/tree-sitter/tree-sitter-html.git
13 | [submodule "languages/java/tree-sitter-java"]
14 | path = languages/java/tree-sitter-java
15 | url = https://github.com/tree-sitter/tree-sitter-java.git
16 | [submodule "languages/json/tree-sitter-json"]
17 | path = languages/json/tree-sitter-json
18 | url = https://github.com/tree-sitter/tree-sitter-json.git
19 | [submodule "languages/php/tree-sitter-php"]
20 | path = languages/php/tree-sitter-php
21 | url = https://github.com/tree-sitter/tree-sitter-php.git
22 |
--------------------------------------------------------------------------------
/.github/workflows/test.yml:
--------------------------------------------------------------------------------
1 | name: Build and test
2 |
3 | on:
4 | pull_request:
5 | push:
6 | branches: [master]
7 |
8 | jobs:
9 | macos_test:
10 | name: Test macOS
11 | strategy:
12 | matrix:
13 | macVersion: ["11.0", "10.15"]
14 |
15 | runs-on: macos-${{ matrix.macVersion }}
16 |
17 | steps:
18 | - uses: actions/checkout@v2
19 | with:
20 | submodules: true
21 | - name: Run the test suite on macOS ${{ matrix.macVersion }}
22 | shell: bash
23 | run: |
24 | set -ex
25 | swift test
26 |
27 | ubuntu_test:
28 | name: Test Ubuntu
29 | strategy:
30 | matrix:
31 | ubuntuVersion: ["18.04", "20.04"]
32 |
33 | runs-on: ubuntu-${{ matrix.ubuntuVersion }}
34 |
35 | steps:
36 | - uses: actions/checkout@v2
37 | with:
38 | submodules: true
39 | - name: Run the test suite on Ubuntu ${{ matrix.ubuntuVersion }}
40 | shell: bash
41 | run: |
42 | set -ex
43 | swift test --enable-test-discovery
44 |
--------------------------------------------------------------------------------
/Tests/SwiftTreeSitterTests/TreeCursorTests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // TreeCursorTests.swift
3 | // SwiftTreeSitterTests
4 | //
5 | // Created by Viktor Strate Kløvedal on 24/05/2020.
6 | // Copyright © 2020 viktorstrate. All rights reserved.
7 | //
8 |
9 | import XCTest
10 | @testable import SwiftTreeSitter
11 |
12 | class TreeCursorTests: XCTestCase {
13 |
14 | var cursor: STSTreeCursor!
15 |
16 | override func setUpWithError() throws {
17 | let language = try STSLanguage(fromPreBundle: .json)
18 | let parser = STSParser(language: language)
19 |
20 | let tree = parser.parse(string: "[1,null, 3]", oldTree: nil)!
21 | self.cursor = tree.walk()
22 | }
23 |
24 | func testGotoFunctions() throws {
25 | XCTAssertEqual(cursor.gotoFirstChild(), true)
26 | XCTAssertEqual(cursor.currentNode.type, "array")
27 |
28 | XCTAssertEqual(cursor.gotoFirstChild(), true)
29 | XCTAssertEqual(cursor.gotoNextSibling(), true)
30 | XCTAssertEqual(cursor.currentNode.type, "number")
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/languages/javascript/javascript/info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | STSLoadFunction
6 | tree_sitter_javascript
7 | TreeSitter
8 |
9 | Scope
10 | source.js
11 | Filetypes
12 |
13 | js
14 | jsx
15 |
16 | Highlights
17 |
18 | queries/highlights-jsx.scm
19 | queries/highlights.scm
20 |
21 |
22 | CFBundleExecutable
23 | javascript
24 | CFBundleIdentifier
25 | io.github.viktorstrate.SwiftTreeSitter.language.javascript
26 | CFBundleName
27 | javascript
28 | CFBundleShortVersionString
29 | 0.16.0
30 | CFBundleSupportedPlatforms
31 |
32 | MacOSX
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 Viktor Strate Kløvedal
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/Sources/SwiftTreeSitter/STSInputEdit.swift:
--------------------------------------------------------------------------------
1 | //
2 | // STSInputEdit.swift
3 | // SwiftTreeSitter
4 | //
5 | // Created by Viktor Strate Kløvedal on 26/05/2020.
6 | // Copyright © 2020 viktorstrate. All rights reserved.
7 | //
8 |
9 | #if _XCODE_BUILD_
10 | import SwiftTreeSitter.CTreeSitter
11 | #else
12 | import CTreeSitter
13 | #endif
14 |
15 | public struct STSInputEdit: Equatable, Hashable {
16 | public let startByte: uint
17 | public let oldEndByte: uint
18 | public let newEndByte: uint
19 | public let startPoint: STSPoint
20 | public let oldEndPoint: STSPoint
21 | public let newEndPoint: STSPoint
22 |
23 | public init(startByte: uint, oldEndByte: uint, newEndByte: uint, startPoint: STSPoint, oldEndPoint: STSPoint, newEndPoint: STSPoint) {
24 | self.startByte = startByte
25 | self.oldEndByte = oldEndByte
26 | self.newEndByte = newEndByte
27 | self.startPoint = startPoint
28 | self.oldEndPoint = oldEndPoint
29 | self.newEndPoint = newEndPoint
30 | }
31 |
32 | internal func tsInputEdit() -> TSInputEdit {
33 | return TSInputEdit(
34 | start_byte: startByte,
35 | old_end_byte: oldEndByte,
36 | new_end_byte: newEndByte,
37 | start_point: startPoint.tsPoint,
38 | old_end_point: oldEndPoint.tsPoint,
39 | new_end_point: newEndPoint.tsPoint)
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/Sources/SwiftTreeSitter/STSRange.swift:
--------------------------------------------------------------------------------
1 | //
2 | // STSRange.swift
3 | // SwiftTreeSitter
4 | //
5 | // Created by Viktor Strate Kløvedal on 30/05/2020.
6 | // Copyright © 2020 viktorstrate. All rights reserved.
7 | //
8 |
9 | #if _XCODE_BUILD_
10 | import SwiftTreeSitter.CTreeSitter
11 | #else
12 | import CTreeSitter
13 | #endif
14 |
15 | public struct STSRange: Equatable, Hashable {
16 | public let startPoint: STSPoint
17 | public let endPoint: STSPoint
18 | public let startByte: uint
19 | public let endByte: uint
20 |
21 | internal var tsRange: TSRange {
22 | get {
23 | return TSRange(start_point: startPoint.tsPoint, end_point: endPoint.tsPoint, start_byte: startByte, end_byte: endByte)
24 | }
25 | }
26 |
27 | public init(startPoint: STSPoint, endPoint: STSPoint, startByte: uint, endByte: uint) {
28 | self.startPoint = startPoint
29 | self.endPoint = endPoint
30 | self.startByte = startByte
31 | self.endByte = endByte
32 | }
33 |
34 | public init(from node: STSNode) {
35 | self.init(startPoint: node.startPoint, endPoint: node.endPoint, startByte: node.startByte, endByte: node.endByte)
36 | }
37 |
38 | internal init(tsRange: TSRange) {
39 | let sPoint = STSPoint(from: tsRange.start_point)
40 | let ePoint = STSPoint(from: tsRange.end_point)
41 |
42 | self.init(startPoint: sPoint, endPoint: ePoint, startByte: tsRange.start_byte, endByte: tsRange.end_byte)
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/Tests/SwiftTreeSitterTests/QueryCursorTests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // QueryCursorTests.swift
3 | // SwiftTreeSitterTests
4 | //
5 | // Created by Viktor Strate Kløvedal on 26/05/2020.
6 | // Copyright © 2020 viktorstrate. All rights reserved.
7 | //
8 |
9 | import XCTest
10 | @testable import SwiftTreeSitter
11 |
12 | class QueryCursorTests: XCTestCase {
13 |
14 | var query: STSQuery!
15 | var tree: STSTree!
16 |
17 | override func setUpWithError() throws {
18 | let language = try STSLanguage(fromPreBundle: .javascript)
19 |
20 | query = try STSQuery(language: language, source: """
21 | ; Function and method definitions
22 | ;--------------------------------
23 | (function
24 | name: (identifier) @function)
25 | (function_declaration
26 | name: (identifier) @function)
27 | (method_definition
28 | name: (property_identifier) @function.method)
29 | """)
30 |
31 | let parser = STSParser(language: language)
32 | tree = parser.parse(string: "function sum(a, b) { return a + b }", oldTree: nil)
33 |
34 | }
35 |
36 | func testQueryMatches() {
37 | let cursor = STSQueryCursor()
38 | let matches = cursor.matches(query: query, onNode: tree.rootNode)
39 |
40 | let match = matches.next()
41 |
42 | XCTAssertNotNil(match)
43 | XCTAssertEqual(query.captureName(forId: match!.id), "function")
44 |
45 | XCTAssertNil(matches.next())
46 |
47 | var counter = 0
48 | for match in matches {
49 | XCTAssertNotEqual(match.captures.count, 0)
50 | counter += 1
51 | }
52 |
53 | XCTAssertEqual(counter, 1)
54 |
55 | }
56 |
57 | func testQueryCaptures() {
58 | let cursor = STSQueryCursor()
59 | let captures = cursor.captures(query: query, onNode: tree.rootNode)
60 |
61 | let capture = captures.next()
62 |
63 | XCTAssertNotNil(capture)
64 | XCTAssertNil(captures.next())
65 |
66 | var counter = 0
67 | for _ in captures {
68 | counter += 1
69 | }
70 |
71 | XCTAssertEqual(counter, 1)
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/make-language-bundle.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 |
4 | inputPath="$(realpath $1)"
5 |
6 | if [ ! -d "$inputPath" ]; then
7 | echo "Usage: $0 "
8 | exit 1
9 | fi
10 |
11 | if [ ! -f "$inputPath/package.json" ]; then
12 | echo "package.json missing in directory"
13 | exit 1
14 | fi
15 |
16 | languageName="$(jq .name $inputPath/src/grammar.json -r)"
17 | version="$(jq .version $inputPath/package.json -r)"
18 | outputFolder="$(pwd)/$languageName-bundlefiles"
19 |
20 | echo "Building language bundle files for $languageName at $inputPath"
21 |
22 | (cd $inputPath && npm install)
23 | (cd $inputPath && npm run build || echo "WARN: package.json did not have a build command")
24 |
25 | mkdir -p "$outputFolder"
26 |
27 | # Copy source files
28 | sourceFiles=("$inputPath/src/*.c")
29 | headerFiles=("$inputPath/src/tree_sitter/*.h")
30 |
31 | cp $sourceFiles "$outputFolder/"
32 | cp $headerFiles "$outputFolder/"
33 |
34 | # Copy resource files
35 | if [ -d "$inputPath/queries" ]; then
36 | cp -r "$inputPath/queries" "$outputFolder/"
37 | fi
38 |
39 | # Generate xml metadata
40 | if jq . "$inputPath/package.json" &> /dev/null; then
41 | metaScope="$(yq --xml-output '{ key: "Scope", string: ."tree-sitter"[].scope }' $inputPath/package.json)"
42 | metaFiletypes="$(yq --xml-output '{ key: "Filetypes", array: { string: ."tree-sitter"[]."file-types" } }' $inputPath/package.json)"
43 | metaFirstLineRegex="$(yq --xml-output '{ key: "FirstLineRegex", string: ."tree-sitter"[]."first-line-regex" }' $inputPath/package.json)"
44 | metaContentRegex="$(yq --xml-output '{ key: "ContentRegex", string: ."tree-sitter"[]."content-regex" }' $inputPath/package.json)"
45 | metaInjectionRegex="$(yq --xml-output '{ key: "InjectionRegex", string: ."tree-sitter"[]."injection-regex" }' $inputPath/package.json)"
46 | #metaHighlights="$(yq --xml-output '{ key: "Highlights", array: { string: ."tree-sitter"[]."highlights" } }' $inputPath/package.json)"
47 | fi
48 |
49 | cat > "$outputFolder/info.plist" <<-INFOPLIST
50 |
51 |
52 |
53 |
54 | STSLoadFunction
55 | tree_sitter_${languageName}
56 | TreeSitter
57 |
58 | ${metaScope}
59 | ${metaFiletypes}
60 | ${metaFirstLineRegex}
61 | ${metaContentRegex}
62 | ${metaInjectionRegex}
63 |
64 | CFBundleExecutable
65 | ${languageName}
66 | CFBundleIdentifier
67 | io.github.viktorstrate.SwiftTreeSitter.language.${languageName}
68 | CFBundleName
69 | ${languageName}
70 | CFBundleShortVersionString
71 | ${version}
72 | CFBundleSupportedPlatforms
73 |
74 | MacOSX
75 |
76 |
77 |
78 | INFOPLIST
79 |
80 |
--------------------------------------------------------------------------------
/Tests/SwiftTreeSitterTests/QueryTests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // QueryTests.swift
3 | // SwiftTreeSitterTests
4 | //
5 | // Created by Viktor Strate Kløvedal on 26/05/2020.
6 | // Copyright © 2020 viktorstrate. All rights reserved.
7 | //
8 |
9 | import XCTest
10 | @testable import SwiftTreeSitter
11 |
12 | class QueryTests: XCTestCase {
13 |
14 | func testQueryPredicates() throws {
15 | let language = try STSLanguage(fromPreBundle: .html)
16 | let query = try STSQuery(language: language, source: """
17 | ((script_element
18 | (raw_text) @injection.content)
19 | (#set! injection.language "javascript"))
20 |
21 | ((tag_name) @constant
22 | (#match? @constant "^[A-Z][A-Z_]+")
23 | (#eq? @constant "test"))
24 | """)
25 |
26 | var predicates = query.predicates(forPatternIndex: 0)
27 | XCTAssertEqual(predicates.count, 1)
28 | XCTAssertEqual(predicates.first?.name, "set!")
29 | XCTAssertEqual(predicates.first?.args[0], STSQueryPredicateArg.string("injection.language"))
30 | XCTAssertEqual(predicates.first?.args[1], STSQueryPredicateArg.string("javascript"))
31 | XCTAssertEqual(predicates.first?.args.count, 2)
32 |
33 | predicates = query.predicates(forPatternIndex: 1)
34 | XCTAssertEqual(predicates.count, 2)
35 | XCTAssertEqual(predicates[1].name, "match?")
36 | XCTAssertEqual(predicates[1].args[0], STSQueryPredicateArg.capture(1))
37 | XCTAssertEqual(predicates[1].args[1], STSQueryPredicateArg.string("^[A-Z][A-Z_]+"))
38 | XCTAssertEqual(predicates[1].args.count, 2)
39 | }
40 |
41 | func testQueryValues() throws {
42 | let language = try STSLanguage(fromPreBundle: .javascript)
43 | let query = try STSQuery(language: language, source: """
44 | ; Function and method definitions
45 | ;--------------------------------
46 | (function
47 | name: (identifier) @function)
48 | (function_declaration
49 | name: (identifier) @function)
50 | (method_definition
51 | name: (property_identifier) @function.method)
52 | """)
53 |
54 | XCTAssertEqual(query.captureCount, 2)
55 | XCTAssertEqual(query.patternCount, 3)
56 | XCTAssertEqual(query.stringCount, 0)
57 | }
58 |
59 | #if _XCODE_BUILD_
60 | func testLoadingQueryFromBundle() throws {
61 | let language = try STSLanguage(fromPreBundle: .javascript)
62 |
63 | let highlights = try STSQuery.loadBundledQuery(language: language, sourceType: .highlights)
64 | XCTAssertNotNil(highlights)
65 |
66 | let highlightsJsx = try STSQuery.loadBundledQuery(language: language,
67 | sourceType: .custom(name: "highlights-jsx"))
68 | XCTAssertNotNil(highlightsJsx)
69 | }
70 | #endif
71 | }
72 |
--------------------------------------------------------------------------------
/Sources/SwiftTreeSitter/STSTree.swift:
--------------------------------------------------------------------------------
1 | //
2 | // STSTree.swift
3 | // SwiftTreeSitter
4 | //
5 | // Created by Viktor Strate Kløvedal on 23/05/2020.
6 | // Copyright © 2020 viktorstrate. All rights reserved.
7 | //
8 |
9 | #if _XCODE_BUILD_
10 | import SwiftTreeSitter.CTreeSitter
11 | #else
12 | import CTreeSitter
13 | #endif
14 |
15 | /// A tree that represents the syntactic structure of a source code file.
16 | public class STSTree: Equatable, Hashable {
17 |
18 | internal let treePointer: OpaquePointer
19 |
20 | public var rootNode: STSNode {
21 | get {
22 | STSNode(from: ts_tree_root_node(treePointer))
23 | }
24 | }
25 |
26 | public var language: STSLanguage {
27 | get {
28 | let languagePointer = ts_tree_language(treePointer)
29 | return STSLanguage(pointer: languagePointer)
30 | }
31 | }
32 |
33 | init(pointer: OpaquePointer) {
34 | self.treePointer = pointer
35 | }
36 |
37 | deinit {
38 | ts_tree_delete(treePointer)
39 | }
40 |
41 | public func walk() -> STSTreeCursor {
42 | return STSTreeCursor(tree: self, node: self.rootNode)
43 | }
44 |
45 | public func copy() -> STSTree {
46 | return STSTree(pointer: ts_tree_copy(treePointer))
47 | }
48 |
49 | public func edit(_ inputEdit: STSInputEdit) {
50 | withUnsafePointer(to: inputEdit.tsInputEdit()) { (inputEditPtr) -> Void in
51 | ts_tree_edit(treePointer, inputEditPtr)
52 | }
53 | }
54 |
55 | /**
56 | Compare an old edited syntax tree to a new syntax tree representing the same
57 | document, returning an array of ranges whose syntactic structure has changed.
58 |
59 | For this to work correctly, the old syntax tree must have been edited such
60 | that its ranges match up to the new tree. Generally, you'll want to call
61 | this function right after calling one of the `STSParser.parse()` functions.
62 |
63 | - Parameters:
64 | - oldTree: The old tree that was passed to parse.
65 | - newTree: The new tree that was returned from the parser.
66 | */
67 | public static func changedRanges(oldTree: STSTree, newTree: STSTree) -> [STSRange] {
68 |
69 | let lengthPtr = UnsafeMutablePointer.allocate(capacity: 1)
70 | let changesPtr = ts_tree_get_changed_ranges(oldTree.treePointer, newTree.treePointer, lengthPtr)
71 | defer {
72 | lengthPtr.deallocate()
73 | changesPtr?.deallocate()
74 | }
75 |
76 | var ranges: [STSRange] = []
77 |
78 | for _ in 0.. Bool {
87 | return lhs.treePointer == rhs.treePointer
88 | }
89 |
90 | public func hash(into hasher: inout Hasher) {
91 | hasher.combine(treePointer)
92 | }
93 |
94 | }
95 |
--------------------------------------------------------------------------------
/SwiftTreeSitter.xcodeproj/xcshareddata/xcschemes/SwiftTreeSitter.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
33 |
39 |
40 |
41 |
42 |
43 |
53 |
54 |
60 |
61 |
67 |
68 |
69 |
70 |
72 |
73 |
76 |
77 |
78 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Swift Tree Sitter
2 |
3 | This module provides Swift bindings for the [tree-sitter](https://tree-sitter.github.io) parsing library
4 |
5 | ## Installation
6 |
7 | ### Using Swift Package Manager
8 |
9 | Add it as a dependency in the `Package.swift` file.
10 |
11 | ```swift
12 | .package(url: "https://github.com/viktorstrate/swift-tree-sitter", from: "1.0.0")
13 | ```
14 |
15 | Or from Xcode navigate to `File` -> `Swift Packages` -> `Add Package Dependency...`, then enter this url:
16 |
17 | ```
18 | https://github.com/viktorstrate/swift-tree-sitter
19 | ```
20 |
21 | ### Import directly to Xcode
22 |
23 | If you want to load languages from `.bundles` dynamically at runtime, you'll have to import it directly to Xcode as Mac bundles aren't supported using the Swift Package Manager.
24 |
25 | To do this, download the project and drag the folder with the `SwiftTreeSitter.xcodeproj` file into the sidebar of your Xcode project.
26 |
27 | ## Usage
28 |
29 | First you'll need to setup the Parser and specify what language to use.
30 |
31 | ```swift
32 | let javascript = try STSLanguage(fromPreBundle: .javascript)
33 | let parser = STSParser(language: javascript)
34 | ```
35 |
36 | Then you can parse some source code.
37 |
38 | ```swift
39 | let sourceCode = "let x = 1; console.log(x);";
40 | let tree = parser.parse(string: sourceCode, oldTree: nil)!
41 | print(tree.rootNode.sExpressionString!)
42 |
43 | // (program
44 | // (lexical_declaration
45 | // (variable_declarator name: (identifier) value: (number)))
46 | // (expression_statement
47 | // (call_expression function:
48 | // (member_expression object: (identifier)
49 | // property: (property_identifier))
50 | // arguments: (arguments (identifier)))))
51 | ```
52 |
53 | Inspect the syntax tree.
54 |
55 | ```swift
56 | let callExpression = tree.rootNode.child(at: 1).firstChild(forOffset: 0)
57 | print("type:\t\(callExpression.type)")
58 | print("start point:\t\(callExpression.startPoint)")
59 | print("end point:\t\(callExpression.endPoint)")
60 | print("start byte:\t\(callExpression.startByte)")
61 | print("end byte:\t\(callExpression.endByte)")
62 |
63 | // type: call_expression
64 | // start point: STSPoint(row: 0, column: 11)
65 | // end point: STSPoint(row: 0, column: 25)
66 | // start byte: 11
67 | // end byte: 25
68 | ```
69 |
70 | If your source code changes you can update the syntax tree.
71 | This will take less time than to recompute the tree from scratch again.
72 |
73 | ```swift
74 | // replace let with const
75 | let newSourceCode = "const x = 1; console.log(x);";
76 |
77 | tree.edit(
78 | STSInputEdit(
79 | startByte: 0,
80 | oldEndByte: 3,
81 | newEndByte: 5,
82 | startPoint: STSPoint(row: 0, column: 0),
83 | oldEndPoint: STSPoint(row: 0, column: 3),
84 | newEndPoint: STSPoint(row: 0, column: 5)
85 | ))
86 |
87 | let newTree = parser.parse(string: newSourceCode, oldTree: tree)
88 | ```
89 |
90 | ### Parsing text from a custom data source
91 |
92 | If your text is stored in a custom data source,
93 | you can parse it by passing a callback to `.parse()` instead of a `String`.
94 |
95 | ```swift
96 | let sourceLines = [
97 | "let x = 1;\n",
98 | "console.log(x);\n"
99 | ]
100 |
101 | let tree = parser.parse(callback: { (byte, point) -> [Int8] in
102 | if (point.row >= sourceLines.count) {
103 | return []
104 | }
105 |
106 | let line = sourceLines[Int(point.row)]
107 |
108 | let index = line.index(line.startIndex, offsetBy: Int(point.column))
109 | let slice = line[index...]
110 | let array = Array(slice.utf8).map { Int8($0) }
111 |
112 | return array
113 | }, oldTree: nil)
114 | ```
115 |
--------------------------------------------------------------------------------
/Sources/SwiftTreeSitter/STSTreeCursor.swift:
--------------------------------------------------------------------------------
1 | //
2 | // STSTreeCursor.swift
3 | // SwiftTreeSitter
4 | //
5 | // Created by Viktor Strate Kløvedal on 24/05/2020.
6 | // Copyright © 2020 viktorstrate. All rights reserved.
7 | //
8 |
9 | #if _XCODE_BUILD_
10 | import SwiftTreeSitter.CTreeSitter
11 | #else
12 | import CTreeSitter
13 | #endif
14 |
15 | public class STSTreeCursor: Equatable, Hashable {
16 |
17 | // Keep a reference to the cursors's tree,
18 | // to prevent it from being deleted prematurly
19 | internal let treeRef: STSTree
20 |
21 | internal var tsTreeCursor: TSTreeCursor
22 |
23 | /// Tree cursor's current node
24 | public var currentNode: STSNode {
25 | get {
26 | let tsNode = withUnsafePointer(to: &self.tsTreeCursor) { (cursorPointer) -> TSNode in
27 | ts_tree_cursor_current_node(cursorPointer)
28 | }
29 | return STSNode(from: tsNode)
30 | }
31 | }
32 |
33 | public var fieldName: String? {
34 | get {
35 |
36 | let cstr = withUnsafePointer(to: &self.tsTreeCursor) { (cursorPointer) -> UnsafePointer? in
37 | ts_tree_cursor_current_field_name(cursorPointer)
38 | }
39 |
40 | if let cstr = cstr {
41 | return String(cString: cstr)
42 | }
43 | return nil
44 | }
45 | }
46 |
47 | public var fieldId: UInt16 {
48 | get {
49 | withUnsafePointer(to: &self.tsTreeCursor) { (cursorPointer) -> UInt16 in
50 | ts_tree_cursor_current_field_id(cursorPointer)
51 | }
52 | }
53 | }
54 |
55 | public init(tree: STSTree, node: STSNode) {
56 | self.treeRef = tree
57 | self.tsTreeCursor = ts_tree_cursor_new(node.tsNode)
58 | }
59 |
60 | deinit {
61 | withUnsafeMutablePointer(to: &self.tsTreeCursor) { (cursorPointer) -> Void in
62 | ts_tree_cursor_delete(cursorPointer)
63 | }
64 | }
65 |
66 | public func reset(node: STSNode) {
67 | withUnsafeMutablePointer(to: &self.tsTreeCursor) { (cursorPointer) -> Void in
68 | ts_tree_cursor_reset(cursorPointer, node.tsNode)
69 | }
70 | }
71 |
72 | public func gotoFirstChild() -> Bool {
73 | return withUnsafeMutablePointer(to: &self.tsTreeCursor) { (cursorPointer) -> Bool in
74 | ts_tree_cursor_goto_first_child(cursorPointer)
75 | }
76 | }
77 |
78 | public func gotoParent() -> Bool {
79 | return withUnsafeMutablePointer(to: &self.tsTreeCursor) { (cursorPointer) -> Bool in
80 | ts_tree_cursor_goto_parent(cursorPointer)
81 | }
82 | }
83 |
84 | public func gotoNextSibling() -> Bool {
85 | return withUnsafeMutablePointer(to: &self.tsTreeCursor) { (cursorPointer) -> Bool in
86 | ts_tree_cursor_goto_next_sibling(cursorPointer)
87 | }
88 | }
89 |
90 | public func gotoFirstChildForByte(index: uint) -> uint? {
91 | let result = withUnsafeMutablePointer(to: &self.tsTreeCursor) { (cursorPointer) -> Int64 in
92 | ts_tree_cursor_goto_first_child_for_byte(cursorPointer, index)
93 | }
94 |
95 | if result < 0 {
96 | return nil
97 | }
98 |
99 | return uint(result)
100 | }
101 |
102 | public static func == (lhs: STSTreeCursor, rhs: STSTreeCursor) -> Bool {
103 | return lhs.tsTreeCursor.id == rhs.tsTreeCursor.id
104 | }
105 |
106 | public func hash(into hasher: inout Hasher) {
107 | hasher.combine(tsTreeCursor.id)
108 | }
109 |
110 | }
111 |
--------------------------------------------------------------------------------
/SwiftTreeSitter.xcodeproj/xcshareddata/xcschemes/SwiftTreeSitter-Package.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
43 |
49 |
50 |
51 |
52 |
53 |
58 |
59 |
61 |
67 |
68 |
69 |
70 |
71 |
81 |
82 |
88 |
89 |
91 |
92 |
95 |
96 |
97 |
--------------------------------------------------------------------------------
/Tests/SwiftTreeSitterTests/ParserTests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SwiftTreeSitterTests.swift
3 | // SwiftTreeSitterTests
4 | //
5 | // Created by Viktor Strate Kløvedal on 23/05/2020.
6 | // Copyright © 2020 viktorstrate. All rights reserved.
7 | //
8 |
9 | import XCTest
10 | @testable import SwiftTreeSitter
11 |
12 | class ParserTests: XCTestCase {
13 |
14 | private var parser: STSParser!
15 |
16 | override func setUpWithError() throws {
17 | let language = try STSLanguage(fromPreBundle: .json)
18 | parser = STSParser(language: language)
19 | }
20 |
21 | func testParserLoadLanguage() throws {
22 | XCTAssertNotNil(parser.language)
23 | }
24 |
25 | func testParseString() {
26 | let tree = parser.parse(string: "[1,2,3]", oldTree: nil)!
27 | XCTAssertEqual(tree.rootNode.type, "document")
28 | XCTAssertEqual(tree.rootNode.sExpressionString, "(document (array (number) (number) (number)))")
29 | }
30 |
31 | func testParseWithCallback() {
32 |
33 | var count = 0
34 | let chunks = ["[1,", "2,", "\n3]"]
35 |
36 | let tree = parser.parse(callback: { (byteIndex, position) -> [Int8] in
37 |
38 |
39 | switch count {
40 | case 0:
41 | XCTAssertEqual(byteIndex, 0)
42 | XCTAssertEqual(position.row, 0)
43 | XCTAssertEqual(position.column, 0)
44 | case 1:
45 | XCTAssertEqual(byteIndex, 3)
46 | XCTAssertEqual(position.row, 0)
47 | XCTAssertEqual(position.column, 3)
48 | case 2:
49 | XCTAssertEqual(byteIndex, 5)
50 | XCTAssertEqual(position.row, 0)
51 | XCTAssertEqual(position.column, 5)
52 | case 3:
53 | XCTAssertEqual(byteIndex, 8)
54 | XCTAssertEqual(position.row, 1)
55 | XCTAssertEqual(position.column, 2)
56 | default:
57 | XCTAssert(false)
58 | }
59 |
60 | if count >= chunks.count {
61 | return []
62 | }
63 |
64 | var result = chunks[count].cString(using: .utf8)!
65 | result.removeLast() // remove null termination
66 |
67 | count += 1
68 |
69 | return result
70 |
71 | }, oldTree: nil)
72 |
73 | XCTAssertEqual(count, 3)
74 |
75 | XCTAssertNotNil(tree)
76 | XCTAssertEqual(tree!.rootNode.type, "document")
77 | XCTAssertEqual(tree!.rootNode.sExpressionString, "(document (array (number) (number) (number)))")
78 | }
79 |
80 | func testParserCancellation() {
81 |
82 | let longJson = "[ \(String.init(repeating: "123,", count: 200)) 123 ]"
83 |
84 | parser.isCanceled = true
85 | let treeCanceled = parser.parse(string: longJson, oldTree: nil)
86 | XCTAssertNil(treeCanceled)
87 |
88 | parser.reset()
89 | parser.isCanceled = false
90 | let treeNotCanceled = parser.parse(string: longJson, oldTree: nil)
91 | XCTAssertNotNil(treeNotCanceled)
92 |
93 | }
94 |
95 | func testParserTimeout() {
96 | XCTAssertNotEqual(parser.timeoutMicros, 12345)
97 | parser.timeoutMicros = 12345
98 | XCTAssertEqual(parser.timeoutMicros, 12345)
99 | }
100 |
101 | func testParserIncludedRanges() {
102 | XCTAssertEqual(parser.includedRanges.count, 1)
103 |
104 | let newRanges = [
105 | STSRange(startPoint: STSPoint(row: 0, column: 1), endPoint: STSPoint(row: 0, column: 2), startByte: 1, endByte: 2),
106 | STSRange(startPoint: STSPoint(row: 0, column: 3), endPoint: STSPoint(row: 0, column: 4), startByte: 3, endByte: 4)
107 | ]
108 |
109 |
110 | let success = parser.setIncludedRanges(newRanges)
111 | XCTAssertTrue(success)
112 | XCTAssertEqual(parser.includedRanges.count, 2)
113 | XCTAssertEqual(parser.includedRanges[0].startByte, 1)
114 | XCTAssertEqual(parser.includedRanges[0].endByte, 2)
115 | XCTAssertEqual(parser.includedRanges[1].startByte, 3)
116 | XCTAssertEqual(parser.includedRanges[1].endByte, 4)
117 |
118 | parser.clearIncludedRanges()
119 | }
120 |
121 | }
122 |
--------------------------------------------------------------------------------
/Sources/SwiftTreeSitter/STSQueryCursor.swift:
--------------------------------------------------------------------------------
1 | //
2 | // STSQueryCursor.swift
3 | // SwiftTreeSitter
4 | //
5 | // Created by Viktor Strate Kløvedal on 26/05/2020.
6 | // Copyright © 2020 viktorstrate. All rights reserved.
7 | //
8 |
9 | #if _XCODE_BUILD_
10 | import SwiftTreeSitter.CTreeSitter
11 | #else
12 | import CTreeSitter
13 | #endif
14 |
15 | public class STSQueryCursor {
16 |
17 | internal var byteRange: (uint, uint)?
18 | internal var pointRange: (STSPoint, STSPoint)?
19 |
20 | public init() {}
21 |
22 | public init(byteRangeFrom start: uint, to end: uint) {
23 | self.byteRange = (start, end)
24 | }
25 |
26 | public init(pointRangeFrom start: STSPoint, end: STSPoint) {
27 | self.pointRange = (start, end)
28 | }
29 |
30 | internal static func setRanges(cursor: STSQueryCursor, pointer: OpaquePointer) {
31 | if let (start, end) = cursor.byteRange {
32 | ts_query_cursor_set_byte_range(pointer, start, end)
33 | }
34 |
35 | if let (start, end) = cursor.pointRange {
36 | ts_query_cursor_set_point_range(pointer, start.tsPoint, end.tsPoint)
37 | }
38 |
39 | }
40 |
41 | public func matches(query: STSQuery, onNode node: STSNode) -> MatchSequence {
42 | return MatchSequence(queryCursor: self, query: query, node: node)
43 | }
44 |
45 | public class MatchSequence: Sequence, IteratorProtocol {
46 |
47 | let queryCursor: STSQueryCursor
48 | let cursorPointer: OpaquePointer
49 | let query: STSQuery
50 | let node: STSNode
51 |
52 | fileprivate init(queryCursor: STSQueryCursor, query: STSQuery, node: STSNode) {
53 | self.queryCursor = queryCursor
54 | self.cursorPointer = ts_query_cursor_new()
55 | self.query = query
56 | self.node = node
57 |
58 | STSQueryCursor.setRanges(cursor: queryCursor, pointer: cursorPointer)
59 | ts_query_cursor_exec(cursorPointer, query.queryPointer, node.tsNode)
60 | }
61 |
62 | deinit {
63 | ts_query_cursor_delete(cursorPointer)
64 | }
65 |
66 | public func makeIterator() -> STSQueryCursor.MatchSequence {
67 | return MatchSequence(queryCursor: self.queryCursor, query: query, node: node)
68 | }
69 |
70 | public func next() -> STSQueryMatch? {
71 | let matchPtr = UnsafeMutablePointer.allocate(capacity: 1)
72 |
73 | if ts_query_cursor_next_match(cursorPointer, matchPtr) == false {
74 | return nil
75 | }
76 |
77 | var captures: [STSQueryCapture] = []
78 | var capturePtr = matchPtr.pointee.captures!
79 |
80 | for _ in 0.. CaptureSequence {
99 | return CaptureSequence(queryCursor: self, query: query, node: node)
100 | }
101 |
102 | public class CaptureSequence: Sequence, IteratorProtocol {
103 |
104 | let queryCursor: STSQueryCursor
105 | let cursorPointer: OpaquePointer
106 | let query: STSQuery
107 | let node: STSNode
108 |
109 | fileprivate init(queryCursor: STSQueryCursor, query: STSQuery, node: STSNode) {
110 | self.queryCursor = queryCursor
111 | self.cursorPointer = ts_query_cursor_new()
112 | self.query = query
113 | self.node = node
114 |
115 | STSQueryCursor.setRanges(cursor: queryCursor, pointer: cursorPointer)
116 | ts_query_cursor_exec(cursorPointer, query.queryPointer, node.tsNode)
117 | }
118 |
119 | deinit {
120 | ts_query_cursor_delete(cursorPointer)
121 | }
122 |
123 | public func makeIterator() -> STSQueryCursor.CaptureSequence {
124 | return CaptureSequence(queryCursor: self.queryCursor, query: query, node: node)
125 | }
126 |
127 | public func next() -> STSQueryCapture? {
128 | let matchPtr = UnsafeMutablePointer.allocate(capacity: 1)
129 | let captureIndex = UnsafeMutablePointer.allocate(capacity: 1)
130 |
131 | if ts_query_cursor_next_capture(cursorPointer, matchPtr, captureIndex) == false {
132 | return nil
133 | }
134 |
135 | let capturePtr = matchPtr.pointee.captures + Int(captureIndex.pointee)
136 |
137 | let node = STSNode(from: capturePtr.pointee.node)
138 | let capture = STSQueryCapture(query: query, node: node, index: capturePtr.pointee.index)
139 |
140 | return capture
141 | }
142 | }
143 |
144 | }
145 |
--------------------------------------------------------------------------------
/Sources/SwiftTreeSitter/STSQuery.swift:
--------------------------------------------------------------------------------
1 | //
2 | // STSQuery.swift
3 | // SwiftTreeSitter
4 | //
5 | // Created by Viktor Strate Kløvedal on 26/05/2020.
6 | // Copyright © 2020 viktorstrate. All rights reserved.
7 | //
8 |
9 | #if _XCODE_BUILD_
10 | import SwiftTreeSitter.CTreeSitter
11 | #else
12 | import CTreeSitter
13 | #endif
14 |
15 | public class STSQuery: Equatable, Hashable {
16 |
17 | internal let queryPointer: OpaquePointer
18 | internal let language: STSLanguage
19 |
20 | /**
21 | Create a new query from a string containing one or more S-expression patterns.
22 |
23 | The query is associated with a particular language, and can only be run on syntax nodes parsed with that language. References to Queries can be shared between multiple threads.
24 |
25 | - Parameters:
26 | - language: The language queries will be run against
27 | - source: A string containing one or more S-expression patterns
28 | */
29 | public init(language: STSLanguage, source: String) throws {
30 |
31 | self.language = language
32 |
33 | let errorOffset = UnsafeMutablePointer.allocate(capacity: 1)
34 | let errorType = UnsafeMutablePointer.allocate(capacity: 1)
35 |
36 | defer {
37 | errorOffset.deallocate()
38 | errorType.deallocate()
39 | }
40 |
41 | let pointer = source.withCString { (cstr) -> OpaquePointer? in
42 | ts_query_new(language.languagePointer, cstr, UInt32(source.utf8.count), errorOffset, errorType)
43 | }
44 |
45 | switch errorType.pointee.rawValue {
46 | case 1:
47 | throw QueryError.syntax(offset: errorOffset.pointee)
48 | case 2:
49 | throw QueryError.nodeType(offset: errorOffset.pointee)
50 | case 3:
51 | throw QueryError.field(offset: errorOffset.pointee)
52 | case 4:
53 | throw QueryError.capture(offset: errorOffset.pointee)
54 | default:
55 | queryPointer = pointer!
56 | }
57 |
58 | }
59 |
60 | deinit {
61 | ts_query_delete(queryPointer)
62 | }
63 |
64 | #if _XCODE_BUILD_
65 | public static func loadBundledQuery(language: STSLanguage, sourceType: BundledSourceType) throws -> STSQuery? {
66 |
67 | let name: String
68 | switch sourceType {
69 | case .highlights:
70 | name = "highlights"
71 | case .injections:
72 | name = "injections"
73 | case .locals:
74 | name = "locals"
75 | case .tags:
76 | name = "tags"
77 | case .custom(let customName):
78 | name = customName
79 | }
80 |
81 | guard let url = language.bundle?.url(forResource: name, withExtension: "scm", subdirectory: "queries") else {
82 | return nil
83 | }
84 |
85 | let source = try String(contentsOf: url)
86 |
87 | return try STSQuery(language: language, source: source)
88 | }
89 |
90 | public enum BundledSourceType {
91 | case highlights
92 | case injections
93 | case locals
94 | case tags
95 | case custom(name: String)
96 | }
97 | #endif
98 |
99 | /// Number of patterns the query contains
100 | public var patternCount: uint {
101 | get {
102 | ts_query_pattern_count(queryPointer)
103 | }
104 | }
105 |
106 | /// Number of captures the query contains
107 | public var captureCount: uint {
108 | get {
109 | ts_query_capture_count(queryPointer)
110 | }
111 | }
112 |
113 | public func captureName(forId id: uint) -> String {
114 | let lengthPtr = UnsafeMutablePointer.allocate(capacity: 1)
115 | defer {
116 | lengthPtr.deallocate()
117 | }
118 |
119 | let cstr = ts_query_capture_name_for_id(queryPointer, id, lengthPtr)
120 | return String(cString: cstr!)
121 | }
122 |
123 | /// Number of string literals the query contains
124 | public var stringCount: uint {
125 | get {
126 | ts_query_string_count(queryPointer)
127 | }
128 | }
129 |
130 | public func stringValue(forId id: uint) -> String {
131 | let lengthPtr = UnsafeMutablePointer.allocate(capacity: 1)
132 | defer {
133 | lengthPtr.deallocate()
134 | }
135 |
136 | let cstr = ts_query_string_value_for_id(queryPointer, id, lengthPtr)
137 | return String(cString: cstr!)
138 | }
139 |
140 | public func startByteForPattern(index: uint) -> uint {
141 | return ts_query_start_byte_for_pattern(queryPointer, index)
142 | }
143 |
144 | public func predicates(forPatternIndex index: uint) -> [STSQueryPredicate] {
145 | let lengthPtr = UnsafeMutablePointer.allocate(capacity: 1)
146 | defer {
147 | lengthPtr.deallocate()
148 | }
149 |
150 | guard let steps = ts_query_predicates_for_pattern(queryPointer, index, lengthPtr) else {
151 | return []
152 | }
153 |
154 | var predicates: [STSQueryPredicate] = []
155 | var count = 0
156 |
157 | while count < lengthPtr.pointee {
158 |
159 | var args: [STSQueryPredicateArg] = []
160 | let name = self.stringValue(forId: steps.pointee.value_id)
161 | count += 1
162 |
163 | argsLoop: for j in 1 ..< .max {
164 | let step = (steps + UnsafePointer.Stride(j)).pointee
165 | count += 1
166 |
167 | let predicateArg: STSQueryPredicateArg
168 |
169 | switch step.type.rawValue {
170 | case 1:
171 | predicateArg = .capture(step.value_id)
172 | case 2:
173 | predicateArg = .string(self.stringValue(forId: step.value_id))
174 | default:
175 | break argsLoop
176 | }
177 |
178 | args.append(predicateArg)
179 | }
180 |
181 | predicates.append(STSQueryPredicate(name: name, args: args))
182 | }
183 |
184 | return predicates
185 | }
186 |
187 | public enum QueryError: Error {
188 | case syntax(offset: uint)
189 | case nodeType(offset: uint)
190 | case field(offset: uint)
191 | case capture(offset: uint)
192 | }
193 |
194 | public static func == (lhs: STSQuery, rhs: STSQuery) -> Bool {
195 | return lhs.queryPointer == rhs.queryPointer
196 | }
197 |
198 | public func hash(into hasher: inout Hasher) {
199 | hasher.combine(queryPointer)
200 | }
201 |
202 | }
203 |
--------------------------------------------------------------------------------
/Sources/SwiftTreeSitter/STSLanguage.swift:
--------------------------------------------------------------------------------
1 | //
2 | // STSParserLanguage.swift
3 | // SwiftTreeSitter
4 | //
5 | // Created by Viktor Strate Kløvedal on 24/05/2020.
6 | // Copyright © 2020 viktorstrate. All rights reserved.
7 | //
8 |
9 | #if _XCODE_BUILD_
10 | import SwiftTreeSitter.CTreeSitter
11 | #else
12 | import CTreeSitter
13 | import TreeSitterLanguages
14 | #endif
15 | import Foundation
16 |
17 | public class STSLanguage: Equatable, Hashable {
18 |
19 | internal let languagePointer: UnsafePointer!
20 | internal var bundle: Bundle?
21 |
22 | /// The path to the bundle that the language was loaded from.
23 | public var bundlePath: String? {
24 | get {
25 | bundle?.bundlePath
26 | }
27 | }
28 |
29 | init(pointer: UnsafePointer!) {
30 | self.languagePointer = pointer
31 | }
32 |
33 | /// The version of the language parser.
34 | public var version: uint {
35 | get {
36 | return ts_language_version(languagePointer) as uint
37 | }
38 | }
39 |
40 | /// Get the number of distinct node types in the language.
41 | public var symbolCount: uint {
42 | get {
43 | return ts_language_symbol_count(languagePointer)
44 | }
45 | }
46 |
47 | /// Get a node type string for the given numerical id.
48 | public func symbolName(forId id: uint) -> String? {
49 | let cstr = ts_language_symbol_name(languagePointer, UInt16(id))
50 | if let cstr = cstr {
51 | return String(cString: cstr)
52 | }
53 |
54 | return nil
55 | }
56 |
57 | /// Get the numerical id for the given node type string.
58 | public func symbolId(forName name: String, isNamed: Bool) -> uint {
59 | let result = name.withCString { (cstr) -> UInt16 in
60 | ts_language_symbol_for_name(languagePointer, cstr, uint(name.utf8.count), isNamed)
61 | }
62 |
63 | return uint(result)
64 | }
65 |
66 | /**
67 | Check whether the given node type id belongs to named nodes, anonymous nodes,
68 | or a hidden nodes.
69 |
70 | See also `node.isNamed`. Hidden nodes are never returned from the API.
71 | */
72 | public func symbolType(forId id: uint) -> SymbolType {
73 | let type = ts_language_symbol_type(languagePointer, UInt16(id))
74 | switch type {
75 | case .init(0):
76 | return .regular
77 | case .init(1):
78 | return .anonymous
79 | case .init(2):
80 | return .auxillary
81 | default:
82 | fatalError()
83 | }
84 | }
85 |
86 | public enum SymbolType {
87 | case regular
88 | case anonymous
89 | case auxillary
90 | }
91 |
92 | /// Get the number of distinct field names in the language.
93 | public var fieldCount: uint {
94 | get {
95 | return ts_language_field_count(languagePointer)
96 | }
97 | }
98 |
99 | /// Get the field name string for the given numerical id.
100 | public func fieldId(forName name: String) -> uint {
101 | let result = name.withCString { (cstr) -> UInt16 in
102 | ts_language_field_id_for_name(languagePointer, cstr, uint(name.utf8.count))
103 | }
104 |
105 | return uint(result)
106 | }
107 |
108 | /// Get the numerical id for the given field name string.
109 | public func fieldName(forId id: uint) -> String? {
110 | let cstr = ts_language_field_name_for_id(languagePointer, UInt16(id))
111 | if let cstr = cstr {
112 | return String(cString: cstr)
113 | }
114 |
115 | return nil
116 | }
117 |
118 | public enum PrebundledLanguage: String {
119 | case css = "css"
120 | case html = "html"
121 | case java = "java"
122 | case javascript = "javascript"
123 | case json = "json"
124 | case php = "php"
125 |
126 | #if _XCODE_BUILD_
127 | public func bundle() throws -> Bundle {
128 | let languageName = self.rawValue
129 |
130 | guard let bundlePath = Bundle(for: STSParser.self).path(forResource: languageName, ofType: "bundle", inDirectory: "PlugIns/languages") else {
131 |
132 | throw LanguageError.prebundledBundleNotFound
133 | }
134 |
135 |
136 | return Bundle(path: bundlePath)!
137 | }
138 | #endif
139 | }
140 |
141 | /**
142 | Initialize a language from one of the pre-bundled ones.
143 |
144 | # Example
145 |
146 | ```
147 | let language = STSLanguage(preBundle: .javascript)
148 | ```
149 | */
150 | public convenience init(fromPreBundle preBundle: PrebundledLanguage) throws {
151 | #if _XCODE_BUILD_
152 | let bundle = try preBundle.bundle()
153 | try self.init(fromBundle: bundle)
154 | #else
155 | switch preBundle {
156 | case .css:
157 | self.init(pointer: tree_sitter_css())
158 | case .html:
159 | self.init(pointer: tree_sitter_html())
160 | case .java:
161 | self.init(pointer: tree_sitter_java())
162 | case .javascript:
163 | self.init(pointer: tree_sitter_javascript())
164 | case .json:
165 | self.init(pointer: tree_sitter_json())
166 | case .php:
167 | self.init(pointer: tree_sitter_php())
168 | }
169 | #endif
170 | }
171 |
172 | #if _XCODE_BUILD_
173 | /// Initialize a language from the given language bundle.
174 | public convenience init(fromBundle bundle: Bundle) throws {
175 |
176 | guard let functionName = bundle.infoDictionary!["STSLoadFunction"] as? String else {
177 | throw LanguageError.malformedLanguageBundle(message: "STSLoadFunction entry missing in info.plist")
178 | }
179 |
180 | try self.init(bundle: bundle, functionName: functionName)
181 | }
182 |
183 | internal convenience init(bundle: Bundle, functionName: String) throws {
184 |
185 | let path = bundle.bundlePath
186 |
187 | let bundleURL = CFURLCreateWithFileSystemPath(
188 | kCFAllocatorDefault,
189 | path as CFString,
190 | .cfurlposixPathStyle,
191 | true)!
192 |
193 | let cfBundle = CFBundleCreate(kCFAllocatorDefault, bundleURL)!
194 |
195 | guard let rawPointer = CFBundleGetFunctionPointerForName(cfBundle, functionName as CFString) else {
196 | throw LanguageError.malformedLanguageBundle(message: "Could not load function pointer")
197 | }
198 |
199 | let loadLanguage = unsafeBitCast(rawPointer, to: (@convention(c)() -> UnsafePointer).self)
200 | let languagePtr = loadLanguage()
201 |
202 | self.init(pointer: languagePtr)
203 |
204 | self.bundle = bundle
205 | }
206 | #endif
207 |
208 | enum LanguageError: Error {
209 | case prebundledBundleNotFound
210 | case malformedLanguageBundle(message: String)
211 | }
212 |
213 | public static func == (lhs: STSLanguage, rhs: STSLanguage) -> Bool {
214 | #if os(WASI)
215 | return lhs.languagePointer == rhs.languagePointer
216 | #else
217 | return lhs.languagePointer == rhs.languagePointer &&
218 | lhs.bundle == rhs.bundle
219 | #endif
220 | }
221 |
222 | public func hash(into hasher: inout Hasher) {
223 | hasher.combine(languagePointer)
224 | #if !os(WASI)
225 | hasher.combine(bundle)
226 | #endif
227 | }
228 | }
229 |
--------------------------------------------------------------------------------
/Sources/SwiftTreeSitter/STSNode.swift:
--------------------------------------------------------------------------------
1 | //
2 | // STSNode.swift
3 | // SwiftTreeSitter
4 | //
5 | // Created by Viktor Strate Kløvedal on 24/05/2020.
6 | // Copyright © 2020 viktorstrate. All rights reserved.
7 | //
8 |
9 | #if _XCODE_BUILD_
10 | import SwiftTreeSitter.CTreeSitter
11 | #else
12 | import CTreeSitter
13 | #endif
14 |
15 | public class STSNode: Equatable, Hashable {
16 |
17 | internal var tsNode: TSNode
18 |
19 | init(from tsNode: TSNode) {
20 | self.tsNode = tsNode
21 | }
22 |
23 | public static func == (lhs: STSNode, rhs: STSNode) -> Bool {
24 | ts_node_eq(lhs.tsNode, rhs.tsNode)
25 | }
26 |
27 | /// A numeric id for this node that is unique.
28 | public var id: uint {
29 | get {
30 | tsNode.id.load(as: uint.self)
31 | }
32 | }
33 |
34 | /// Get the node's type.
35 | public var type: String {
36 | get {
37 | let cstr = ts_node_type(tsNode)!
38 | return String(cString: cstr)
39 | }
40 | }
41 |
42 | /// Get the node's type as a numerical id.
43 | public var typeId: UInt16 {
44 | get {
45 | let symbol = ts_node_symbol(tsNode)
46 | return symbol
47 | }
48 | }
49 |
50 | /// Get an S-expression representing the node as a string.
51 | public var sExpressionString: String? {
52 | get {
53 | let cstr = ts_node_string(tsNode)
54 | if let cstr = cstr {
55 | let result = String(cString: cstr)
56 | cstr.deallocate()
57 |
58 | return result
59 | }
60 |
61 | return nil
62 | }
63 | }
64 |
65 | /**
66 |
67 | Check if the node is null. Functions like `.child()` and
68 | `.nextSibling()` will return a null node to indicate that no such node
69 | was found.
70 |
71 | */
72 | public var isNull: Bool {
73 | get {
74 | ts_node_is_null(tsNode)
75 | }
76 | }
77 |
78 | /**
79 | Check if the node is *named*. Named nodes correspond to named rules in the
80 | grammar, whereas *anonymous* nodes correspond to string literals in the
81 | grammar.
82 | */
83 | public var isNamed: Bool {
84 | get {
85 | ts_node_is_named(tsNode)
86 | }
87 | }
88 |
89 |
90 | /**
91 | Check if the node is *extra*. Extra nodes represent things like comments,
92 | which are not required by the grammar, but can appear anywhere.
93 | */
94 | public var isExtra: Bool {
95 | get {
96 | ts_node_is_extra(tsNode)
97 | }
98 | }
99 |
100 | /// Check if a syntax node has been edited.
101 | public var hasChanges: Bool {
102 | get {
103 | ts_node_has_changes(tsNode)
104 | }
105 | }
106 |
107 | /// Check if the node is a syntax error or contains any syntax errors.
108 | public var hasError: Bool {
109 | get {
110 | ts_node_has_error(tsNode)
111 | }
112 | }
113 |
114 | /**
115 | Check if the node is *missing*. Missing nodes are inserted by the parser in
116 | order to recover from certain kinds of syntax errors.
117 | */
118 | public var isMissing: Bool {
119 | get {
120 | ts_node_is_missing(tsNode)
121 | }
122 | }
123 |
124 | /// Get the node's start byte.
125 | public var startByte: uint {
126 | get {
127 | ts_node_start_byte(tsNode)
128 | }
129 | }
130 |
131 | /// Get the node's end byte.
132 | public var endByte: uint {
133 | get {
134 | ts_node_end_byte(tsNode)
135 | }
136 | }
137 |
138 | /// Get the node's byte range from startByte to endByte
139 | public var byteRange: Range {
140 | get {
141 | startByte ..< endByte
142 | }
143 | }
144 |
145 | /// Get the node's start position in terms of rows and columns.
146 | public var startPoint: STSPoint {
147 | get {
148 | STSPoint(from: ts_node_start_point(tsNode))
149 | }
150 | }
151 |
152 | /// Get the node's end position in terms of rows and columns.
153 | public var endPoint: STSPoint {
154 | get {
155 | STSPoint(from: ts_node_end_point(tsNode))
156 | }
157 | }
158 |
159 | /// Get the node's immediate parent.
160 | public func parent() -> STSNode {
161 | return STSNode(from: ts_node_parent(tsNode))
162 | }
163 |
164 | /// Get the node's number of children.
165 | public var childCount: uint {
166 | get {
167 | ts_node_child_count(tsNode)
168 | }
169 | }
170 |
171 | /**
172 | Get the node's child at the given index, where zero represents the first
173 | child.
174 |
175 | - Parameters:
176 | - index: The index of the child. The value must be between 0 and `childCount` (exclusive)
177 |
178 | */
179 | public func child(at index: uint) -> STSNode {
180 | assert(index >= 0 && index < childCount)
181 |
182 | let child = ts_node_child(tsNode, index)
183 | return STSNode(from: child)
184 | }
185 |
186 | /// Get the node's children
187 | public func children() -> [STSNode] {
188 | var children: [STSNode] = []
189 |
190 | for i in 0.. STSNode {
218 | assert(index >= 0 && index < namedChildCount)
219 |
220 | let child = ts_node_named_child(tsNode, index)
221 | return STSNode(from: child)
222 | }
223 |
224 | /**
225 | Get the node's number of named children.
226 |
227 | See also `isNamed`.
228 | */
229 | public func namedChildren() -> [STSNode] {
230 | var children: [STSNode] = []
231 |
232 | for i in 0.. STSNode {
241 | return STSNode(from: ts_node_next_sibling(tsNode))
242 | }
243 |
244 | /// Get the node's next sibling.
245 | public func previousSibling() -> STSNode {
246 | return STSNode(from: ts_node_prev_sibling(tsNode))
247 | }
248 |
249 | /**
250 | Get the node's next named sibling.
251 |
252 | See also `isNamed`.
253 | */
254 | public func nextNamedSibling() -> STSNode {
255 | return STSNode(from: ts_node_next_named_sibling(tsNode))
256 | }
257 |
258 | /**
259 | Get the node's previous named sibling
260 |
261 | See also `isNamed`.
262 | */
263 | public func previousNamedSibling() -> STSNode {
264 | return STSNode(from: ts_node_prev_named_sibling(tsNode))
265 | }
266 |
267 | /// Get the node's first child that extends beyond the given byte offset.
268 | public func firstChild(forOffset offset: uint) -> STSNode {
269 | return STSNode(from: ts_node_first_child_for_byte(tsNode, offset))
270 | }
271 |
272 | /**
273 | Get the node's first named child that extends beyond the given byte offset.
274 |
275 | See also `isNamed`.
276 | */
277 | public func firstNamedChild(forOffset offset: uint) -> STSNode {
278 | return STSNode(from: ts_node_first_named_child_for_byte(tsNode, offset))
279 | }
280 |
281 | /// Get the smallest node within this node that spans the given range of bytes.
282 | public func descendantForRange(startByte: uint, endByte: uint) -> STSNode {
283 | let des = ts_node_descendant_for_byte_range(tsNode, startByte, endByte)
284 | return STSNode(from: des)
285 | }
286 |
287 | /// Get the smallest node within this node that spans the given range of (row, column) positions.
288 | public func descendantForPoint(startPoint: STSPoint, endPoint: STSPoint) -> STSNode {
289 | let des = ts_node_descendant_for_point_range(tsNode, startPoint.tsPoint, endPoint.tsPoint)
290 | return STSNode(from: des)
291 | }
292 |
293 | /**
294 | Edit the node to keep it in-sync with source code that has been edited.
295 |
296 | This function is only rarely needed. When you edit a syntax tree with the
297 | `tree.edit()` function, all of the nodes that you retrieve from the tree
298 | afterward will already reflect the edit. You only need to use `node.edit()`
299 | when you have a `STSNode` instance that you want to keep and continue to use
300 | after an edit.
301 | */
302 | public func edit(_ inputEdit: STSInputEdit) {
303 | withUnsafePointer(to: inputEdit.tsInputEdit()) { (inputEditPtr) -> Void in
304 | withUnsafeMutablePointer(to: &tsNode) { (tsNodePtr) -> Void in
305 | ts_node_edit(tsNodePtr, inputEditPtr)
306 | }
307 | }
308 | }
309 |
310 | public func hash(into hasher: inout Hasher) {
311 | hasher.combine(tsNode.id)
312 | }
313 |
314 | }
315 |
--------------------------------------------------------------------------------
/Sources/SwiftTreeSitter/STSParser.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Parser.swift
3 | // SwiftTreeSitter
4 | //
5 | // Created by Viktor Strate Kløvedal on 23/05/2020.
6 | // Copyright © 2020 viktorstrate. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | #if _XCODE_BUILD_
11 | import SwiftTreeSitter.CTreeSitter
12 | #else
13 | import CTreeSitter
14 | #endif
15 |
16 | /// Used to produce `STSTree`s from source code
17 | public class STSParser: Equatable, Hashable {
18 |
19 | internal var parserPointer: OpaquePointer!
20 |
21 | /// The language that the parser should use for parsing.
22 | public var language: STSLanguage {
23 | set(newValue) {
24 | ts_parser_set_language(parserPointer, newValue.languagePointer)
25 | }
26 |
27 | get {
28 | let languagePointer = ts_parser_language(parserPointer)!
29 | return STSLanguage(pointer: languagePointer)
30 | }
31 | }
32 |
33 | /// The maximum duration in microseconds that parsing should be allowed to take before halting.
34 | public var timeoutMicros: UInt64 {
35 | get {
36 | ts_parser_timeout_micros(parserPointer)
37 | }
38 |
39 | set(timeout) {
40 | ts_parser_set_timeout_micros(parserPointer, timeout)
41 | }
42 | }
43 |
44 | internal let cancelPtr: UnsafeMutablePointer
45 |
46 | /// The parser will periodically read this value during parsing. If it reads `false`, it will halt early, returning `nil`.
47 | public var isCanceled: Bool {
48 | get {
49 | cancelPtr.pointee != 0
50 | }
51 |
52 | set(canceled) {
53 | cancelPtr.initialize(to: canceled ? 1 : 0)
54 | }
55 | }
56 |
57 | /// Get the ranges of text that the parser will include when parsing.
58 | public var includedRanges: [STSRange] {
59 | get {
60 | let lengthPtr = UnsafeMutablePointer.allocate(capacity: 1)
61 | defer {
62 | lengthPtr.deallocate()
63 | }
64 |
65 | guard let rangePtrs = ts_parser_included_ranges(parserPointer, lengthPtr) else {
66 | return []
67 | }
68 |
69 | var ranges: [STSRange] = []
70 |
71 | for i in 0 ..< lengthPtr.pointee {
72 | let tsRange = (rangePtrs + UnsafePointer.Stride(i)).pointee
73 | ranges.append(STSRange(tsRange: tsRange))
74 | }
75 |
76 | return ranges
77 | }
78 | }
79 |
80 | /**
81 | Set the ranges of text that the parser should include when parsing.
82 |
83 | By default, the parser will always include entire documents. This function
84 | allows you to parse only a *portion* of a document but still return a syntax
85 | tree whose ranges match up with the document as a whole. You can also pass
86 | multiple disjoint ranges.
87 |
88 | If `length` is zero, then the entire document will be parsed. Otherwise,
89 | the given ranges must be ordered from earliest to latest in the document,
90 | and they must not overlap. That is, the following must hold for all
91 | `i < length - 1`:
92 |
93 | ```
94 | ranges[i].endByte <= ranges[i + 1].startByte
95 | ```
96 |
97 | If this requirement is not satisfied, the operation will fail, the ranges
98 | will not be assigned, and this function will return `false`. On success,
99 | this function returns `true`
100 | */
101 | public func setIncludedRanges(_ ranges: [STSRange]) -> Bool {
102 | let tsRanges = ranges.map { $0.tsRange }
103 |
104 | let success = tsRanges.withUnsafeBufferPointer { (rangesPtr) -> Bool in
105 | return ts_parser_set_included_ranges(parserPointer, rangesPtr.baseAddress, uint(tsRanges.count))
106 | }
107 |
108 | return success
109 | }
110 |
111 | /// Clear the previously set included ranges and instead include the entire document.
112 | public func clearIncludedRanges() {
113 | let success = ts_parser_set_included_ranges(parserPointer, nil, uint(0))
114 | assert(success, "clearing the parser should always be successful")
115 | }
116 |
117 | public init(language: STSLanguage) {
118 | self.parserPointer = ts_parser_new()
119 |
120 | cancelPtr = UnsafeMutablePointer.allocate(capacity: 1)
121 | cancelPtr.initialize(to: 0)
122 | ts_parser_set_cancellation_flag(parserPointer, cancelPtr)
123 |
124 | self.language = language
125 | }
126 |
127 | deinit {
128 | ts_parser_delete(parserPointer)
129 | cancelPtr.deallocate()
130 | }
131 |
132 | /// Parses a string, returning a `STSTree` representing the AST for the given string.
133 | public func parse(string: String, oldTree: STSTree?) -> STSTree? {
134 | let treePointer = string.withCString { (stringPtr) -> OpaquePointer? in
135 | return ts_parser_parse_string(parserPointer, oldTree?.treePointer, stringPtr, UInt32(string.utf8.count))
136 | }
137 |
138 | if let treePointer = treePointer {
139 | return STSTree(pointer: treePointer)
140 | }
141 |
142 | return nil
143 | }
144 |
145 | /**
146 | A function to retrieve a chunk of text at a given byte offset
147 | and (row, column) position.
148 |
149 | - Parameters:
150 | - byteIndex: The offset to receive the text from
151 | - position: The row and column position to receive text from
152 |
153 | - Returns: A byte array representing the chunk of text.
154 | An empty array indicates the end of the document
155 | */
156 | public typealias ParserCallback = ((_ byteIndex: uint, _ position: STSPoint) -> [Int8])
157 | typealias RawParserCallback = ((UnsafeMutableRawPointer?, UInt32, TSPoint, UnsafeMutablePointer?) -> UnsafePointer?)
158 |
159 | /**
160 | Use the parser to parse some source code and create a syntax tree.
161 |
162 | This function returns a syntax tree on success, and `nil` on failure. There
163 | are three possible reasons for failure:
164 |
165 | 1. The parser does not have a language assigned. Check for this using the
166 | `language` attribute.
167 |
168 | 2. Parsing was cancelled due to a timeout that was set by an earlier assignment to
169 | the `timeoutMicros` attribute. You can resume parsing from
170 | where the parser left out by calling this function again with the
171 | same arguments. Or you can start parsing from scratch by first calling
172 | `parser.reset()`.
173 |
174 | 3. Parsing was cancelled using a cancellation flag that was set by an
175 | earlier assignment to `isCanceled`. You can resume parsing
176 | from where the parser left out by calling this function again with
177 | the same arguments.
178 |
179 | - Parameters:
180 | - callback:
181 | The callback to provide the source code to parse.
182 |
183 | - oldTree:
184 | If you are parsing this document for the first time, pass `nil`. Otherwise, if you have already parsed an earlier
185 | version of this document and the document has since been edited, pass the
186 | previous syntax tree so that the unchanged parts of it can be reused.
187 | This will save time and memory. For this to work correctly, you must have
188 | already edited the old syntax tree using the `tree.edit()` function in a
189 | way that exactly matches the source code changes.
190 | */
191 | public func parse(callback: @escaping ParserCallback, oldTree: STSTree?) -> STSTree? {
192 |
193 | struct Payload {
194 | var callback: ParserCallback
195 | var bytePointes: [UnsafePointer] = []
196 | }
197 |
198 | var payload = Payload(callback: callback)
199 |
200 | let tsInput = withUnsafeMutablePointer(to: &payload) { (callbackPtr) -> TSInput in
201 | return TSInput(
202 | payload: callbackPtr,
203 | read: { (
204 | payload: UnsafeMutableRawPointer?,
205 | byteIndex: UInt32,
206 | position: TSPoint,
207 | bytesRead: UnsafeMutablePointer?) -> UnsafePointer? in
208 |
209 |
210 | var payload = payload!.assumingMemoryBound(to: Payload.self).pointee
211 |
212 | let bytes = payload.callback(byteIndex, STSPoint(from: position))
213 | assert(!(bytes.count > 1 && bytes.last == 0),
214 | "parser callback bytes should not be null terminated")
215 |
216 | bytesRead!.initialize(to: UInt32(bytes.count))
217 |
218 | // Allocate pointer and copy bytes
219 | let resultBytesPtr = UnsafeMutablePointer.allocate(capacity: bytes.count)
220 | for i in 0.. Bool {
280 | return lhs.parserPointer == rhs.parserPointer
281 | }
282 |
283 | public func hash(into hasher: inout Hasher) {
284 | hasher.combine(parserPointer)
285 | }
286 | }
287 |
--------------------------------------------------------------------------------
/languages/json/json.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 50;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 343E14422487AAA70067F56C /* parser.c in Sources */ = {isa = PBXBuildFile; fileRef = 343E14332487AAA70067F56C /* parser.c */; };
11 | /* End PBXBuildFile section */
12 |
13 | /* Begin PBXFileReference section */
14 | 3417850B248004D300843085 /* json.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = json.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
15 | 34178515248004DE00843085 /* info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = info.plist; sourceTree = ""; };
16 | 343E14212487AAA70067F56C /* .npmignore */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = .npmignore; sourceTree = ""; };
17 | 343E14222487AAA70067F56C /* grammar.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = grammar.js; sourceTree = ""; };
18 | 343E14232487AAA70067F56C /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = ""; };
19 | 343E14242487AAA70067F56C /* binding.gyp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = binding.gyp; sourceTree = ""; };
20 | 343E14262487AAA70067F56C /* main.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.txt; sourceTree = ""; };
21 | 343E14272487AAA70067F56C /* index.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = index.js; sourceTree = ""; };
22 | 343E14282487AAA70067F56C /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; };
23 | 343E14292487AAA70067F56C /* .gitignore */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = .gitignore; sourceTree = ""; };
24 | 343E142A2487AAA70067F56C /* package.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = package.json; sourceTree = ""; };
25 | 343E142B2487AAA70067F56C /* .gitattributes */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = .gitattributes; sourceTree = ""; };
26 | 343E142C2487AAA70067F56C /* .travis.yml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.yaml; path = .travis.yml; sourceTree = ""; };
27 | 343E142E2487AAA70067F56C /* binding.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = binding.cc; sourceTree = ""; };
28 | 343E142F2487AAA70067F56C /* node-types.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "node-types.json"; sourceTree = ""; };
29 | 343E14312487AAA70067F56C /* parser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = parser.h; sourceTree = ""; };
30 | 343E14322487AAA70067F56C /* grammar.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = grammar.json; sourceTree = ""; };
31 | 343E14332487AAA70067F56C /* parser.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = parser.c; sourceTree = ""; };
32 | /* End PBXFileReference section */
33 |
34 | /* Begin PBXFrameworksBuildPhase section */
35 | 34178508248004D300843085 /* Frameworks */ = {
36 | isa = PBXFrameworksBuildPhase;
37 | buildActionMask = 2147483647;
38 | files = (
39 | );
40 | runOnlyForDeploymentPostprocessing = 0;
41 | };
42 | /* End PBXFrameworksBuildPhase section */
43 |
44 | /* Begin PBXGroup section */
45 | 34178502248004D300843085 = {
46 | isa = PBXGroup;
47 | children = (
48 | 343E14202487AAA70067F56C /* tree-sitter-json */,
49 | 3417850D248004D300843085 /* json */,
50 | 3417850C248004D300843085 /* Products */,
51 | );
52 | sourceTree = "";
53 | };
54 | 3417850C248004D300843085 /* Products */ = {
55 | isa = PBXGroup;
56 | children = (
57 | 3417850B248004D300843085 /* json.bundle */,
58 | );
59 | name = Products;
60 | sourceTree = "";
61 | };
62 | 3417850D248004D300843085 /* json */ = {
63 | isa = PBXGroup;
64 | children = (
65 | 34178515248004DE00843085 /* info.plist */,
66 | );
67 | path = json;
68 | sourceTree = "";
69 | };
70 | 343E14202487AAA70067F56C /* tree-sitter-json */ = {
71 | isa = PBXGroup;
72 | children = (
73 | 343E14212487AAA70067F56C /* .npmignore */,
74 | 343E14222487AAA70067F56C /* grammar.js */,
75 | 343E14232487AAA70067F56C /* LICENSE */,
76 | 343E14242487AAA70067F56C /* binding.gyp */,
77 | 343E14252487AAA70067F56C /* corpus */,
78 | 343E14272487AAA70067F56C /* index.js */,
79 | 343E14282487AAA70067F56C /* README.md */,
80 | 343E14292487AAA70067F56C /* .gitignore */,
81 | 343E142A2487AAA70067F56C /* package.json */,
82 | 343E142B2487AAA70067F56C /* .gitattributes */,
83 | 343E142C2487AAA70067F56C /* .travis.yml */,
84 | 343E142D2487AAA70067F56C /* src */,
85 | );
86 | path = "tree-sitter-json";
87 | sourceTree = "";
88 | };
89 | 343E14252487AAA70067F56C /* corpus */ = {
90 | isa = PBXGroup;
91 | children = (
92 | 343E14262487AAA70067F56C /* main.txt */,
93 | );
94 | path = corpus;
95 | sourceTree = "";
96 | };
97 | 343E142D2487AAA70067F56C /* src */ = {
98 | isa = PBXGroup;
99 | children = (
100 | 343E142E2487AAA70067F56C /* binding.cc */,
101 | 343E142F2487AAA70067F56C /* node-types.json */,
102 | 343E14302487AAA70067F56C /* tree_sitter */,
103 | 343E14322487AAA70067F56C /* grammar.json */,
104 | 343E14332487AAA70067F56C /* parser.c */,
105 | );
106 | path = src;
107 | sourceTree = "";
108 | };
109 | 343E14302487AAA70067F56C /* tree_sitter */ = {
110 | isa = PBXGroup;
111 | children = (
112 | 343E14312487AAA70067F56C /* parser.h */,
113 | );
114 | path = tree_sitter;
115 | sourceTree = "";
116 | };
117 | /* End PBXGroup section */
118 |
119 | /* Begin PBXNativeTarget section */
120 | 3417850A248004D300843085 /* json */ = {
121 | isa = PBXNativeTarget;
122 | buildConfigurationList = 34178511248004D300843085 /* Build configuration list for PBXNativeTarget "json" */;
123 | buildPhases = (
124 | 34178507248004D300843085 /* Sources */,
125 | 34178508248004D300843085 /* Frameworks */,
126 | 34178509248004D300843085 /* Resources */,
127 | );
128 | buildRules = (
129 | );
130 | dependencies = (
131 | );
132 | name = json;
133 | productName = json;
134 | productReference = 3417850B248004D300843085 /* json.bundle */;
135 | productType = "com.apple.product-type.bundle";
136 | };
137 | /* End PBXNativeTarget section */
138 |
139 | /* Begin PBXProject section */
140 | 34178503248004D300843085 /* Project object */ = {
141 | isa = PBXProject;
142 | attributes = {
143 | LastUpgradeCheck = 1150;
144 | ORGANIZATIONNAME = viktorstrate;
145 | TargetAttributes = {
146 | 3417850A248004D300843085 = {
147 | CreatedOnToolsVersion = 11.5;
148 | };
149 | };
150 | };
151 | buildConfigurationList = 34178506248004D300843085 /* Build configuration list for PBXProject "json" */;
152 | compatibilityVersion = "Xcode 9.3";
153 | developmentRegion = en;
154 | hasScannedForEncodings = 0;
155 | knownRegions = (
156 | en,
157 | Base,
158 | );
159 | mainGroup = 34178502248004D300843085;
160 | productRefGroup = 3417850C248004D300843085 /* Products */;
161 | projectDirPath = "";
162 | projectRoot = "";
163 | targets = (
164 | 3417850A248004D300843085 /* json */,
165 | );
166 | };
167 | /* End PBXProject section */
168 |
169 | /* Begin PBXResourcesBuildPhase section */
170 | 34178509248004D300843085 /* Resources */ = {
171 | isa = PBXResourcesBuildPhase;
172 | buildActionMask = 2147483647;
173 | files = (
174 | );
175 | runOnlyForDeploymentPostprocessing = 0;
176 | };
177 | /* End PBXResourcesBuildPhase section */
178 |
179 | /* Begin PBXSourcesBuildPhase section */
180 | 34178507248004D300843085 /* Sources */ = {
181 | isa = PBXSourcesBuildPhase;
182 | buildActionMask = 2147483647;
183 | files = (
184 | 343E14422487AAA70067F56C /* parser.c in Sources */,
185 | );
186 | runOnlyForDeploymentPostprocessing = 0;
187 | };
188 | /* End PBXSourcesBuildPhase section */
189 |
190 | /* Begin XCBuildConfiguration section */
191 | 3417850F248004D300843085 /* Debug */ = {
192 | isa = XCBuildConfiguration;
193 | buildSettings = {
194 | ALWAYS_SEARCH_USER_PATHS = NO;
195 | CLANG_ANALYZER_NONNULL = YES;
196 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
197 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
198 | CLANG_CXX_LIBRARY = "libc++";
199 | CLANG_ENABLE_MODULES = YES;
200 | CLANG_ENABLE_OBJC_ARC = YES;
201 | CLANG_ENABLE_OBJC_WEAK = YES;
202 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
203 | CLANG_WARN_BOOL_CONVERSION = YES;
204 | CLANG_WARN_COMMA = YES;
205 | CLANG_WARN_CONSTANT_CONVERSION = YES;
206 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
207 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
208 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
209 | CLANG_WARN_EMPTY_BODY = YES;
210 | CLANG_WARN_ENUM_CONVERSION = YES;
211 | CLANG_WARN_INFINITE_RECURSION = YES;
212 | CLANG_WARN_INT_CONVERSION = YES;
213 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
214 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
215 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
216 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
217 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
218 | CLANG_WARN_STRICT_PROTOTYPES = YES;
219 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
220 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
221 | CLANG_WARN_UNREACHABLE_CODE = YES;
222 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
223 | COPY_PHASE_STRIP = NO;
224 | DEBUG_INFORMATION_FORMAT = dwarf;
225 | ENABLE_STRICT_OBJC_MSGSEND = YES;
226 | ENABLE_TESTABILITY = YES;
227 | GCC_C_LANGUAGE_STANDARD = gnu11;
228 | GCC_DYNAMIC_NO_PIC = NO;
229 | GCC_NO_COMMON_BLOCKS = YES;
230 | GCC_OPTIMIZATION_LEVEL = 0;
231 | GCC_PREPROCESSOR_DEFINITIONS = (
232 | "DEBUG=1",
233 | "$(inherited)",
234 | );
235 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
236 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
237 | GCC_WARN_UNDECLARED_SELECTOR = YES;
238 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
239 | GCC_WARN_UNUSED_FUNCTION = YES;
240 | GCC_WARN_UNUSED_VARIABLE = YES;
241 | MACOSX_DEPLOYMENT_TARGET = 10.15;
242 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
243 | MTL_FAST_MATH = YES;
244 | ONLY_ACTIVE_ARCH = YES;
245 | SDKROOT = macosx;
246 | };
247 | name = Debug;
248 | };
249 | 34178510248004D300843085 /* Release */ = {
250 | isa = XCBuildConfiguration;
251 | buildSettings = {
252 | ALWAYS_SEARCH_USER_PATHS = NO;
253 | CLANG_ANALYZER_NONNULL = YES;
254 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
255 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
256 | CLANG_CXX_LIBRARY = "libc++";
257 | CLANG_ENABLE_MODULES = YES;
258 | CLANG_ENABLE_OBJC_ARC = YES;
259 | CLANG_ENABLE_OBJC_WEAK = YES;
260 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
261 | CLANG_WARN_BOOL_CONVERSION = YES;
262 | CLANG_WARN_COMMA = YES;
263 | CLANG_WARN_CONSTANT_CONVERSION = YES;
264 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
265 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
266 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
267 | CLANG_WARN_EMPTY_BODY = YES;
268 | CLANG_WARN_ENUM_CONVERSION = YES;
269 | CLANG_WARN_INFINITE_RECURSION = YES;
270 | CLANG_WARN_INT_CONVERSION = YES;
271 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
272 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
273 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
274 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
275 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
276 | CLANG_WARN_STRICT_PROTOTYPES = YES;
277 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
278 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
279 | CLANG_WARN_UNREACHABLE_CODE = YES;
280 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
281 | COPY_PHASE_STRIP = NO;
282 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
283 | ENABLE_NS_ASSERTIONS = NO;
284 | ENABLE_STRICT_OBJC_MSGSEND = YES;
285 | GCC_C_LANGUAGE_STANDARD = gnu11;
286 | GCC_NO_COMMON_BLOCKS = YES;
287 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
288 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
289 | GCC_WARN_UNDECLARED_SELECTOR = YES;
290 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
291 | GCC_WARN_UNUSED_FUNCTION = YES;
292 | GCC_WARN_UNUSED_VARIABLE = YES;
293 | MACOSX_DEPLOYMENT_TARGET = 10.15;
294 | MTL_ENABLE_DEBUG_INFO = NO;
295 | MTL_FAST_MATH = YES;
296 | SDKROOT = macosx;
297 | };
298 | name = Release;
299 | };
300 | 34178512248004D300843085 /* Debug */ = {
301 | isa = XCBuildConfiguration;
302 | buildSettings = {
303 | CODE_SIGN_STYLE = Automatic;
304 | COMBINE_HIDPI_IMAGES = YES;
305 | HEADER_SEARCH_PATHS = "$PROJECT_DIR/tree-sitter-json/src";
306 | INFOPLIST_FILE = json/Info.plist;
307 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
308 | PRODUCT_BUNDLE_IDENTIFIER = io.github.viktorstrate.SwiftTreeSitter.language.json;
309 | PRODUCT_NAME = "$(TARGET_NAME)";
310 | SKIP_INSTALL = YES;
311 | SUPPORTED_PLATFORMS = "macosx iphoneos iphonesimulator";
312 | VALID_ARCHS = "i386 x86_64 arm64 armv7 armv7s";
313 | WRAPPER_EXTENSION = bundle;
314 | };
315 | name = Debug;
316 | };
317 | 34178513248004D300843085 /* Release */ = {
318 | isa = XCBuildConfiguration;
319 | buildSettings = {
320 | CODE_SIGN_STYLE = Automatic;
321 | COMBINE_HIDPI_IMAGES = YES;
322 | HEADER_SEARCH_PATHS = "$PROJECT_DIR/tree-sitter-json/src";
323 | INFOPLIST_FILE = json/Info.plist;
324 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
325 | PRODUCT_BUNDLE_IDENTIFIER = io.github.viktorstrate.SwiftTreeSitter.language.json;
326 | PRODUCT_NAME = "$(TARGET_NAME)";
327 | SKIP_INSTALL = YES;
328 | SUPPORTED_PLATFORMS = "macosx iphoneos iphonesimulator";
329 | VALID_ARCHS = "i386 x86_64 arm64 armv7 armv7s";
330 | WRAPPER_EXTENSION = bundle;
331 | };
332 | name = Release;
333 | };
334 | /* End XCBuildConfiguration section */
335 |
336 | /* Begin XCConfigurationList section */
337 | 34178506248004D300843085 /* Build configuration list for PBXProject "json" */ = {
338 | isa = XCConfigurationList;
339 | buildConfigurations = (
340 | 3417850F248004D300843085 /* Debug */,
341 | 34178510248004D300843085 /* Release */,
342 | );
343 | defaultConfigurationIsVisible = 0;
344 | defaultConfigurationName = Release;
345 | };
346 | 34178511248004D300843085 /* Build configuration list for PBXNativeTarget "json" */ = {
347 | isa = XCConfigurationList;
348 | buildConfigurations = (
349 | 34178512248004D300843085 /* Debug */,
350 | 34178513248004D300843085 /* Release */,
351 | );
352 | defaultConfigurationIsVisible = 0;
353 | defaultConfigurationName = Release;
354 | };
355 | /* End XCConfigurationList section */
356 | };
357 | rootObject = 34178503248004D300843085 /* Project object */;
358 | }
359 |
--------------------------------------------------------------------------------
/languages/css/css.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 50;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 343E137A2487A8D30067F56C /* scanner.c in Sources */ = {isa = PBXBuildFile; fileRef = 343E13622487A8D30067F56C /* scanner.c */; };
11 | 343E137E2487A8D30067F56C /* parser.c in Sources */ = {isa = PBXBuildFile; fileRef = 343E13682487A8D30067F56C /* parser.c */; };
12 | 343E13BB2487A9C40067F56C /* queries in Resources */ = {isa = PBXBuildFile; fileRef = 343E13BA2487A9C40067F56C /* queries */; };
13 | /* End PBXBuildFile section */
14 |
15 | /* Begin PBXFileReference section */
16 | 343E10A324859D3E0067F56C /* css.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = css.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
17 | 343E10AE24859D500067F56C /* info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = info.plist; sourceTree = ""; };
18 | 343E134D2487A8D30067F56C /* grammar.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = grammar.js; sourceTree = ""; };
19 | 343E134E2487A8D30067F56C /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = ""; };
20 | 343E134F2487A8D30067F56C /* binding.gyp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = binding.gyp; sourceTree = ""; };
21 | 343E13512487A8D30067F56C /* stylesheets.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = stylesheets.txt; sourceTree = ""; };
22 | 343E13522487A8D30067F56C /* selectors.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = selectors.txt; sourceTree = ""; };
23 | 343E13532487A8D30067F56C /* declarations.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = declarations.txt; sourceTree = ""; };
24 | 343E13542487A8D30067F56C /* statements.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = statements.txt; sourceTree = ""; };
25 | 343E13562487A8D30067F56C /* highlights.scm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = highlights.scm; sourceTree = ""; };
26 | 343E13572487A8D30067F56C /* index.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = index.js; sourceTree = ""; };
27 | 343E13582487A8D30067F56C /* .appveyor.yml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.yaml; path = .appveyor.yml; sourceTree = ""; };
28 | 343E13592487A8D30067F56C /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; };
29 | 343E135A2487A8D30067F56C /* .gitignore */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = .gitignore; sourceTree = ""; };
30 | 343E135B2487A8D30067F56C /* package.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = package.json; sourceTree = ""; };
31 | 343E135D2487A8D30067F56C /* github.com.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = github.com.css; sourceTree = ""; };
32 | 343E135E2487A8D30067F56C /* atom.io.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = atom.io.css; sourceTree = ""; };
33 | 343E135F2487A8D30067F56C /* .gitattributes */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = .gitattributes; sourceTree = ""; };
34 | 343E13602487A8D30067F56C /* .travis.yml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.yaml; path = .travis.yml; sourceTree = ""; };
35 | 343E13622487A8D30067F56C /* scanner.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = scanner.c; sourceTree = ""; };
36 | 343E13632487A8D30067F56C /* binding.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = binding.cc; sourceTree = ""; };
37 | 343E13642487A8D30067F56C /* node-types.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "node-types.json"; sourceTree = ""; };
38 | 343E13662487A8D30067F56C /* parser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = parser.h; sourceTree = ""; };
39 | 343E13672487A8D30067F56C /* grammar.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = grammar.json; sourceTree = ""; };
40 | 343E13682487A8D30067F56C /* parser.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = parser.c; sourceTree = ""; };
41 | 343E13BA2487A9C40067F56C /* queries */ = {isa = PBXFileReference; lastKnownFileType = folder; name = queries; path = "tree-sitter-css/queries"; sourceTree = ""; };
42 | /* End PBXFileReference section */
43 |
44 | /* Begin PBXFrameworksBuildPhase section */
45 | 343E10A024859D3E0067F56C /* Frameworks */ = {
46 | isa = PBXFrameworksBuildPhase;
47 | buildActionMask = 2147483647;
48 | files = (
49 | );
50 | runOnlyForDeploymentPostprocessing = 0;
51 | };
52 | /* End PBXFrameworksBuildPhase section */
53 |
54 | /* Begin PBXGroup section */
55 | 343E109A24859D3E0067F56C = {
56 | isa = PBXGroup;
57 | children = (
58 | 343E13BA2487A9C40067F56C /* queries */,
59 | 343E134C2487A8D30067F56C /* tree-sitter-css */,
60 | 343E10A524859D3E0067F56C /* css */,
61 | 343E10A424859D3E0067F56C /* Products */,
62 | );
63 | sourceTree = "";
64 | };
65 | 343E10A424859D3E0067F56C /* Products */ = {
66 | isa = PBXGroup;
67 | children = (
68 | 343E10A324859D3E0067F56C /* css.bundle */,
69 | );
70 | name = Products;
71 | sourceTree = "";
72 | };
73 | 343E10A524859D3E0067F56C /* css */ = {
74 | isa = PBXGroup;
75 | children = (
76 | 343E10AE24859D500067F56C /* info.plist */,
77 | );
78 | path = css;
79 | sourceTree = "";
80 | };
81 | 343E134C2487A8D30067F56C /* tree-sitter-css */ = {
82 | isa = PBXGroup;
83 | children = (
84 | 343E134D2487A8D30067F56C /* grammar.js */,
85 | 343E134E2487A8D30067F56C /* LICENSE */,
86 | 343E134F2487A8D30067F56C /* binding.gyp */,
87 | 343E13502487A8D30067F56C /* corpus */,
88 | 343E13552487A8D30067F56C /* queries */,
89 | 343E13572487A8D30067F56C /* index.js */,
90 | 343E13582487A8D30067F56C /* .appveyor.yml */,
91 | 343E13592487A8D30067F56C /* README.md */,
92 | 343E135A2487A8D30067F56C /* .gitignore */,
93 | 343E135B2487A8D30067F56C /* package.json */,
94 | 343E135C2487A8D30067F56C /* examples */,
95 | 343E135F2487A8D30067F56C /* .gitattributes */,
96 | 343E13602487A8D30067F56C /* .travis.yml */,
97 | 343E13612487A8D30067F56C /* src */,
98 | );
99 | path = "tree-sitter-css";
100 | sourceTree = "";
101 | };
102 | 343E13502487A8D30067F56C /* corpus */ = {
103 | isa = PBXGroup;
104 | children = (
105 | 343E13512487A8D30067F56C /* stylesheets.txt */,
106 | 343E13522487A8D30067F56C /* selectors.txt */,
107 | 343E13532487A8D30067F56C /* declarations.txt */,
108 | 343E13542487A8D30067F56C /* statements.txt */,
109 | );
110 | path = corpus;
111 | sourceTree = "";
112 | };
113 | 343E13552487A8D30067F56C /* queries */ = {
114 | isa = PBXGroup;
115 | children = (
116 | 343E13562487A8D30067F56C /* highlights.scm */,
117 | );
118 | path = queries;
119 | sourceTree = "";
120 | };
121 | 343E135C2487A8D30067F56C /* examples */ = {
122 | isa = PBXGroup;
123 | children = (
124 | 343E135D2487A8D30067F56C /* github.com.css */,
125 | 343E135E2487A8D30067F56C /* atom.io.css */,
126 | );
127 | path = examples;
128 | sourceTree = "";
129 | };
130 | 343E13612487A8D30067F56C /* src */ = {
131 | isa = PBXGroup;
132 | children = (
133 | 343E13622487A8D30067F56C /* scanner.c */,
134 | 343E13632487A8D30067F56C /* binding.cc */,
135 | 343E13642487A8D30067F56C /* node-types.json */,
136 | 343E13652487A8D30067F56C /* tree_sitter */,
137 | 343E13672487A8D30067F56C /* grammar.json */,
138 | 343E13682487A8D30067F56C /* parser.c */,
139 | );
140 | path = src;
141 | sourceTree = "";
142 | };
143 | 343E13652487A8D30067F56C /* tree_sitter */ = {
144 | isa = PBXGroup;
145 | children = (
146 | 343E13662487A8D30067F56C /* parser.h */,
147 | );
148 | path = tree_sitter;
149 | sourceTree = "";
150 | };
151 | /* End PBXGroup section */
152 |
153 | /* Begin PBXNativeTarget section */
154 | 343E10A224859D3E0067F56C /* css */ = {
155 | isa = PBXNativeTarget;
156 | buildConfigurationList = 343E10A924859D3E0067F56C /* Build configuration list for PBXNativeTarget "css" */;
157 | buildPhases = (
158 | 343E109F24859D3E0067F56C /* Sources */,
159 | 343E10A024859D3E0067F56C /* Frameworks */,
160 | 343E10A124859D3E0067F56C /* Resources */,
161 | );
162 | buildRules = (
163 | );
164 | dependencies = (
165 | );
166 | name = css;
167 | productName = css;
168 | productReference = 343E10A324859D3E0067F56C /* css.bundle */;
169 | productType = "com.apple.product-type.bundle";
170 | };
171 | /* End PBXNativeTarget section */
172 |
173 | /* Begin PBXProject section */
174 | 343E109B24859D3E0067F56C /* Project object */ = {
175 | isa = PBXProject;
176 | attributes = {
177 | LastUpgradeCheck = 1150;
178 | ORGANIZATIONNAME = viktorstrate;
179 | TargetAttributes = {
180 | 343E10A224859D3E0067F56C = {
181 | CreatedOnToolsVersion = 11.5;
182 | };
183 | };
184 | };
185 | buildConfigurationList = 343E109E24859D3E0067F56C /* Build configuration list for PBXProject "css" */;
186 | compatibilityVersion = "Xcode 9.3";
187 | developmentRegion = en;
188 | hasScannedForEncodings = 0;
189 | knownRegions = (
190 | en,
191 | Base,
192 | );
193 | mainGroup = 343E109A24859D3E0067F56C;
194 | productRefGroup = 343E10A424859D3E0067F56C /* Products */;
195 | projectDirPath = "";
196 | projectRoot = "";
197 | targets = (
198 | 343E10A224859D3E0067F56C /* css */,
199 | );
200 | };
201 | /* End PBXProject section */
202 |
203 | /* Begin PBXResourcesBuildPhase section */
204 | 343E10A124859D3E0067F56C /* Resources */ = {
205 | isa = PBXResourcesBuildPhase;
206 | buildActionMask = 2147483647;
207 | files = (
208 | 343E13BB2487A9C40067F56C /* queries in Resources */,
209 | );
210 | runOnlyForDeploymentPostprocessing = 0;
211 | };
212 | /* End PBXResourcesBuildPhase section */
213 |
214 | /* Begin PBXSourcesBuildPhase section */
215 | 343E109F24859D3E0067F56C /* Sources */ = {
216 | isa = PBXSourcesBuildPhase;
217 | buildActionMask = 2147483647;
218 | files = (
219 | 343E137A2487A8D30067F56C /* scanner.c in Sources */,
220 | 343E137E2487A8D30067F56C /* parser.c in Sources */,
221 | );
222 | runOnlyForDeploymentPostprocessing = 0;
223 | };
224 | /* End PBXSourcesBuildPhase section */
225 |
226 | /* Begin XCBuildConfiguration section */
227 | 343E10A724859D3E0067F56C /* Debug */ = {
228 | isa = XCBuildConfiguration;
229 | buildSettings = {
230 | ALWAYS_SEARCH_USER_PATHS = NO;
231 | CLANG_ANALYZER_NONNULL = YES;
232 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
233 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
234 | CLANG_CXX_LIBRARY = "libc++";
235 | CLANG_ENABLE_MODULES = YES;
236 | CLANG_ENABLE_OBJC_ARC = YES;
237 | CLANG_ENABLE_OBJC_WEAK = YES;
238 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
239 | CLANG_WARN_BOOL_CONVERSION = YES;
240 | CLANG_WARN_COMMA = YES;
241 | CLANG_WARN_CONSTANT_CONVERSION = YES;
242 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
243 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
244 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
245 | CLANG_WARN_EMPTY_BODY = YES;
246 | CLANG_WARN_ENUM_CONVERSION = YES;
247 | CLANG_WARN_INFINITE_RECURSION = YES;
248 | CLANG_WARN_INT_CONVERSION = YES;
249 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
250 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
251 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
252 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
253 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
254 | CLANG_WARN_STRICT_PROTOTYPES = YES;
255 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
256 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
257 | CLANG_WARN_UNREACHABLE_CODE = YES;
258 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
259 | COPY_PHASE_STRIP = NO;
260 | DEBUG_INFORMATION_FORMAT = dwarf;
261 | ENABLE_STRICT_OBJC_MSGSEND = YES;
262 | ENABLE_TESTABILITY = YES;
263 | GCC_C_LANGUAGE_STANDARD = gnu11;
264 | GCC_DYNAMIC_NO_PIC = NO;
265 | GCC_NO_COMMON_BLOCKS = YES;
266 | GCC_OPTIMIZATION_LEVEL = 0;
267 | GCC_PREPROCESSOR_DEFINITIONS = (
268 | "DEBUG=1",
269 | "$(inherited)",
270 | );
271 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
272 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
273 | GCC_WARN_UNDECLARED_SELECTOR = YES;
274 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
275 | GCC_WARN_UNUSED_FUNCTION = YES;
276 | GCC_WARN_UNUSED_VARIABLE = YES;
277 | MACOSX_DEPLOYMENT_TARGET = 10.15;
278 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
279 | MTL_FAST_MATH = YES;
280 | ONLY_ACTIVE_ARCH = YES;
281 | SDKROOT = macosx;
282 | };
283 | name = Debug;
284 | };
285 | 343E10A824859D3E0067F56C /* Release */ = {
286 | isa = XCBuildConfiguration;
287 | buildSettings = {
288 | ALWAYS_SEARCH_USER_PATHS = NO;
289 | CLANG_ANALYZER_NONNULL = YES;
290 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
291 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
292 | CLANG_CXX_LIBRARY = "libc++";
293 | CLANG_ENABLE_MODULES = YES;
294 | CLANG_ENABLE_OBJC_ARC = YES;
295 | CLANG_ENABLE_OBJC_WEAK = YES;
296 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
297 | CLANG_WARN_BOOL_CONVERSION = YES;
298 | CLANG_WARN_COMMA = YES;
299 | CLANG_WARN_CONSTANT_CONVERSION = YES;
300 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
301 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
302 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
303 | CLANG_WARN_EMPTY_BODY = YES;
304 | CLANG_WARN_ENUM_CONVERSION = YES;
305 | CLANG_WARN_INFINITE_RECURSION = YES;
306 | CLANG_WARN_INT_CONVERSION = YES;
307 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
308 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
309 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
310 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
311 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
312 | CLANG_WARN_STRICT_PROTOTYPES = YES;
313 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
314 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
315 | CLANG_WARN_UNREACHABLE_CODE = YES;
316 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
317 | COPY_PHASE_STRIP = NO;
318 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
319 | ENABLE_NS_ASSERTIONS = NO;
320 | ENABLE_STRICT_OBJC_MSGSEND = YES;
321 | GCC_C_LANGUAGE_STANDARD = gnu11;
322 | GCC_NO_COMMON_BLOCKS = YES;
323 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
324 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
325 | GCC_WARN_UNDECLARED_SELECTOR = YES;
326 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
327 | GCC_WARN_UNUSED_FUNCTION = YES;
328 | GCC_WARN_UNUSED_VARIABLE = YES;
329 | MACOSX_DEPLOYMENT_TARGET = 10.15;
330 | MTL_ENABLE_DEBUG_INFO = NO;
331 | MTL_FAST_MATH = YES;
332 | SDKROOT = macosx;
333 | };
334 | name = Release;
335 | };
336 | 343E10AA24859D3E0067F56C /* Debug */ = {
337 | isa = XCBuildConfiguration;
338 | buildSettings = {
339 | CODE_SIGN_STYLE = Automatic;
340 | COMBINE_HIDPI_IMAGES = YES;
341 | HEADER_SEARCH_PATHS = "$PROJECT_DIR/tree-sitter-css/src";
342 | INFOPLIST_FILE = css/Info.plist;
343 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
344 | PRODUCT_BUNDLE_IDENTIFIER = io.github.viktorstrate.SwiftTreeSitter.language.css;
345 | PRODUCT_NAME = "$(TARGET_NAME)";
346 | SKIP_INSTALL = YES;
347 | SUPPORTED_PLATFORMS = "macosx iphoneos iphonesimulator";
348 | VALID_ARCHS = "i386 x86_64 arm64 armv7 armv7s";
349 | WRAPPER_EXTENSION = bundle;
350 | };
351 | name = Debug;
352 | };
353 | 343E10AB24859D3E0067F56C /* Release */ = {
354 | isa = XCBuildConfiguration;
355 | buildSettings = {
356 | CODE_SIGN_STYLE = Automatic;
357 | COMBINE_HIDPI_IMAGES = YES;
358 | HEADER_SEARCH_PATHS = "$PROJECT_DIR/tree-sitter-css/src";
359 | INFOPLIST_FILE = css/Info.plist;
360 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
361 | PRODUCT_BUNDLE_IDENTIFIER = io.github.viktorstrate.SwiftTreeSitter.language.css;
362 | PRODUCT_NAME = "$(TARGET_NAME)";
363 | SKIP_INSTALL = YES;
364 | SUPPORTED_PLATFORMS = "macosx iphoneos iphonesimulator";
365 | VALID_ARCHS = "i386 x86_64 arm64 armv7 armv7s";
366 | WRAPPER_EXTENSION = bundle;
367 | };
368 | name = Release;
369 | };
370 | /* End XCBuildConfiguration section */
371 |
372 | /* Begin XCConfigurationList section */
373 | 343E109E24859D3E0067F56C /* Build configuration list for PBXProject "css" */ = {
374 | isa = XCConfigurationList;
375 | buildConfigurations = (
376 | 343E10A724859D3E0067F56C /* Debug */,
377 | 343E10A824859D3E0067F56C /* Release */,
378 | );
379 | defaultConfigurationIsVisible = 0;
380 | defaultConfigurationName = Release;
381 | };
382 | 343E10A924859D3E0067F56C /* Build configuration list for PBXNativeTarget "css" */ = {
383 | isa = XCConfigurationList;
384 | buildConfigurations = (
385 | 343E10AA24859D3E0067F56C /* Debug */,
386 | 343E10AB24859D3E0067F56C /* Release */,
387 | );
388 | defaultConfigurationIsVisible = 0;
389 | defaultConfigurationName = Release;
390 | };
391 | /* End XCConfigurationList section */
392 | };
393 | rootObject = 343E109B24859D3E0067F56C /* Project object */;
394 | }
395 |
--------------------------------------------------------------------------------
/languages/html/html.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 50;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 343E13B62487A9670067F56C /* parser.c in Sources */ = {isa = PBXBuildFile; fileRef = 343E13A12487A9670067F56C /* parser.c */; };
11 | 343E13B82487A9860067F56C /* queries in Resources */ = {isa = PBXBuildFile; fileRef = 343E13B72487A9860067F56C /* queries */; };
12 | 343E13B92487A9950067F56C /* scanner.cc in Sources */ = {isa = PBXBuildFile; fileRef = 343E13A02487A9670067F56C /* scanner.cc */; };
13 | /* End PBXBuildFile section */
14 |
15 | /* Begin PBXFileReference section */
16 | 343E10BE24859D980067F56C /* html.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = html.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
17 | 343E10C724859DA80067F56C /* info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = info.plist; sourceTree = ""; };
18 | 343E13862487A9670067F56C /* .npmignore */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = .npmignore; sourceTree = ""; };
19 | 343E13872487A9670067F56C /* grammar.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = grammar.js; sourceTree = ""; };
20 | 343E13882487A9670067F56C /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = ""; };
21 | 343E13892487A9670067F56C /* binding.gyp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = binding.gyp; sourceTree = ""; };
22 | 343E138B2487A9670067F56C /* main.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.txt; sourceTree = ""; };
23 | 343E138D2487A9670067F56C /* highlights.scm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = highlights.scm; sourceTree = ""; };
24 | 343E138E2487A9670067F56C /* injections.scm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = injections.scm; sourceTree = ""; };
25 | 343E138F2487A9670067F56C /* index.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = index.js; sourceTree = ""; };
26 | 343E13902487A9670067F56C /* .appveyor.yml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.yaml; path = .appveyor.yml; sourceTree = ""; };
27 | 343E13912487A9670067F56C /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; };
28 | 343E13922487A9670067F56C /* .gitignore */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = .gitignore; sourceTree = ""; };
29 | 343E13932487A9670067F56C /* package.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = package.json; sourceTree = ""; };
30 | 343E13952487A9670067F56C /* deeply-nested.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "deeply-nested.html"; sourceTree = ""; };
31 | 343E13962487A9670067F56C /* deeply-nested-custom.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "deeply-nested-custom.html"; sourceTree = ""; };
32 | 343E13972487A9670067F56C /* .gitattributes */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = .gitattributes; sourceTree = ""; };
33 | 343E13982487A9670067F56C /* .travis.yml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.yaml; path = .travis.yml; sourceTree = ""; };
34 | 343E139A2487A9670067F56C /* binding.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = binding.cc; sourceTree = ""; };
35 | 343E139B2487A9670067F56C /* tag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tag.h; sourceTree = ""; };
36 | 343E139C2487A9670067F56C /* node-types.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "node-types.json"; sourceTree = ""; };
37 | 343E139E2487A9670067F56C /* parser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = parser.h; sourceTree = ""; };
38 | 343E139F2487A9670067F56C /* grammar.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = grammar.json; sourceTree = ""; };
39 | 343E13A02487A9670067F56C /* scanner.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = scanner.cc; sourceTree = ""; };
40 | 343E13A12487A9670067F56C /* parser.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = parser.c; sourceTree = ""; };
41 | 343E13B72487A9860067F56C /* queries */ = {isa = PBXFileReference; lastKnownFileType = folder; name = queries; path = "tree-sitter-html/queries"; sourceTree = ""; };
42 | /* End PBXFileReference section */
43 |
44 | /* Begin PBXFrameworksBuildPhase section */
45 | 343E10BB24859D980067F56C /* Frameworks */ = {
46 | isa = PBXFrameworksBuildPhase;
47 | buildActionMask = 2147483647;
48 | files = (
49 | );
50 | runOnlyForDeploymentPostprocessing = 0;
51 | };
52 | /* End PBXFrameworksBuildPhase section */
53 |
54 | /* Begin PBXGroup section */
55 | 343E10B524859D980067F56C = {
56 | isa = PBXGroup;
57 | children = (
58 | 343E13B72487A9860067F56C /* queries */,
59 | 343E13852487A9670067F56C /* tree-sitter-html */,
60 | 343E10C024859D980067F56C /* html */,
61 | 343E10BF24859D980067F56C /* Products */,
62 | );
63 | sourceTree = "";
64 | };
65 | 343E10BF24859D980067F56C /* Products */ = {
66 | isa = PBXGroup;
67 | children = (
68 | 343E10BE24859D980067F56C /* html.bundle */,
69 | );
70 | name = Products;
71 | sourceTree = "";
72 | };
73 | 343E10C024859D980067F56C /* html */ = {
74 | isa = PBXGroup;
75 | children = (
76 | 343E10C724859DA80067F56C /* info.plist */,
77 | );
78 | path = html;
79 | sourceTree = "";
80 | };
81 | 343E13852487A9670067F56C /* tree-sitter-html */ = {
82 | isa = PBXGroup;
83 | children = (
84 | 343E13862487A9670067F56C /* .npmignore */,
85 | 343E13872487A9670067F56C /* grammar.js */,
86 | 343E13882487A9670067F56C /* LICENSE */,
87 | 343E13892487A9670067F56C /* binding.gyp */,
88 | 343E138A2487A9670067F56C /* corpus */,
89 | 343E138C2487A9670067F56C /* queries */,
90 | 343E138F2487A9670067F56C /* index.js */,
91 | 343E13902487A9670067F56C /* .appveyor.yml */,
92 | 343E13912487A9670067F56C /* README.md */,
93 | 343E13922487A9670067F56C /* .gitignore */,
94 | 343E13932487A9670067F56C /* package.json */,
95 | 343E13942487A9670067F56C /* examples */,
96 | 343E13972487A9670067F56C /* .gitattributes */,
97 | 343E13982487A9670067F56C /* .travis.yml */,
98 | 343E13992487A9670067F56C /* src */,
99 | );
100 | path = "tree-sitter-html";
101 | sourceTree = "";
102 | };
103 | 343E138A2487A9670067F56C /* corpus */ = {
104 | isa = PBXGroup;
105 | children = (
106 | 343E138B2487A9670067F56C /* main.txt */,
107 | );
108 | path = corpus;
109 | sourceTree = "";
110 | };
111 | 343E138C2487A9670067F56C /* queries */ = {
112 | isa = PBXGroup;
113 | children = (
114 | 343E138D2487A9670067F56C /* highlights.scm */,
115 | 343E138E2487A9670067F56C /* injections.scm */,
116 | );
117 | path = queries;
118 | sourceTree = "";
119 | };
120 | 343E13942487A9670067F56C /* examples */ = {
121 | isa = PBXGroup;
122 | children = (
123 | 343E13952487A9670067F56C /* deeply-nested.html */,
124 | 343E13962487A9670067F56C /* deeply-nested-custom.html */,
125 | );
126 | path = examples;
127 | sourceTree = "";
128 | };
129 | 343E13992487A9670067F56C /* src */ = {
130 | isa = PBXGroup;
131 | children = (
132 | 343E139A2487A9670067F56C /* binding.cc */,
133 | 343E139B2487A9670067F56C /* tag.h */,
134 | 343E139C2487A9670067F56C /* node-types.json */,
135 | 343E139D2487A9670067F56C /* tree_sitter */,
136 | 343E139F2487A9670067F56C /* grammar.json */,
137 | 343E13A02487A9670067F56C /* scanner.cc */,
138 | 343E13A12487A9670067F56C /* parser.c */,
139 | );
140 | path = src;
141 | sourceTree = "";
142 | };
143 | 343E139D2487A9670067F56C /* tree_sitter */ = {
144 | isa = PBXGroup;
145 | children = (
146 | 343E139E2487A9670067F56C /* parser.h */,
147 | );
148 | path = tree_sitter;
149 | sourceTree = "";
150 | };
151 | /* End PBXGroup section */
152 |
153 | /* Begin PBXNativeTarget section */
154 | 343E10BD24859D980067F56C /* html */ = {
155 | isa = PBXNativeTarget;
156 | buildConfigurationList = 343E10C424859D980067F56C /* Build configuration list for PBXNativeTarget "html" */;
157 | buildPhases = (
158 | 343E10BA24859D980067F56C /* Sources */,
159 | 343E10BB24859D980067F56C /* Frameworks */,
160 | 343E10BC24859D980067F56C /* Resources */,
161 | );
162 | buildRules = (
163 | );
164 | dependencies = (
165 | );
166 | name = html;
167 | productName = html;
168 | productReference = 343E10BE24859D980067F56C /* html.bundle */;
169 | productType = "com.apple.product-type.bundle";
170 | };
171 | /* End PBXNativeTarget section */
172 |
173 | /* Begin PBXProject section */
174 | 343E10B624859D980067F56C /* Project object */ = {
175 | isa = PBXProject;
176 | attributes = {
177 | LastUpgradeCheck = 1150;
178 | ORGANIZATIONNAME = viktorstrate;
179 | TargetAttributes = {
180 | 343E10BD24859D980067F56C = {
181 | CreatedOnToolsVersion = 11.5;
182 | };
183 | };
184 | };
185 | buildConfigurationList = 343E10B924859D980067F56C /* Build configuration list for PBXProject "html" */;
186 | compatibilityVersion = "Xcode 9.3";
187 | developmentRegion = en;
188 | hasScannedForEncodings = 0;
189 | knownRegions = (
190 | en,
191 | Base,
192 | );
193 | mainGroup = 343E10B524859D980067F56C;
194 | productRefGroup = 343E10BF24859D980067F56C /* Products */;
195 | projectDirPath = "";
196 | projectRoot = "";
197 | targets = (
198 | 343E10BD24859D980067F56C /* html */,
199 | );
200 | };
201 | /* End PBXProject section */
202 |
203 | /* Begin PBXResourcesBuildPhase section */
204 | 343E10BC24859D980067F56C /* Resources */ = {
205 | isa = PBXResourcesBuildPhase;
206 | buildActionMask = 2147483647;
207 | files = (
208 | 343E13B82487A9860067F56C /* queries in Resources */,
209 | );
210 | runOnlyForDeploymentPostprocessing = 0;
211 | };
212 | /* End PBXResourcesBuildPhase section */
213 |
214 | /* Begin PBXSourcesBuildPhase section */
215 | 343E10BA24859D980067F56C /* Sources */ = {
216 | isa = PBXSourcesBuildPhase;
217 | buildActionMask = 2147483647;
218 | files = (
219 | 343E13B62487A9670067F56C /* parser.c in Sources */,
220 | 343E13B92487A9950067F56C /* scanner.cc in Sources */,
221 | );
222 | runOnlyForDeploymentPostprocessing = 0;
223 | };
224 | /* End PBXSourcesBuildPhase section */
225 |
226 | /* Begin XCBuildConfiguration section */
227 | 343E10C224859D980067F56C /* Debug */ = {
228 | isa = XCBuildConfiguration;
229 | buildSettings = {
230 | ALWAYS_SEARCH_USER_PATHS = NO;
231 | CLANG_ANALYZER_NONNULL = YES;
232 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
233 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
234 | CLANG_CXX_LIBRARY = "libc++";
235 | CLANG_ENABLE_MODULES = YES;
236 | CLANG_ENABLE_OBJC_ARC = YES;
237 | CLANG_ENABLE_OBJC_WEAK = YES;
238 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
239 | CLANG_WARN_BOOL_CONVERSION = YES;
240 | CLANG_WARN_COMMA = YES;
241 | CLANG_WARN_CONSTANT_CONVERSION = YES;
242 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
243 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
244 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
245 | CLANG_WARN_EMPTY_BODY = YES;
246 | CLANG_WARN_ENUM_CONVERSION = YES;
247 | CLANG_WARN_INFINITE_RECURSION = YES;
248 | CLANG_WARN_INT_CONVERSION = YES;
249 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
250 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
251 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
252 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
253 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
254 | CLANG_WARN_STRICT_PROTOTYPES = YES;
255 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
256 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
257 | CLANG_WARN_UNREACHABLE_CODE = YES;
258 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
259 | COPY_PHASE_STRIP = NO;
260 | DEBUG_INFORMATION_FORMAT = dwarf;
261 | ENABLE_STRICT_OBJC_MSGSEND = YES;
262 | ENABLE_TESTABILITY = YES;
263 | GCC_C_LANGUAGE_STANDARD = gnu11;
264 | GCC_DYNAMIC_NO_PIC = NO;
265 | GCC_NO_COMMON_BLOCKS = YES;
266 | GCC_OPTIMIZATION_LEVEL = 0;
267 | GCC_PREPROCESSOR_DEFINITIONS = (
268 | "DEBUG=1",
269 | "$(inherited)",
270 | );
271 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
272 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
273 | GCC_WARN_UNDECLARED_SELECTOR = YES;
274 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
275 | GCC_WARN_UNUSED_FUNCTION = YES;
276 | GCC_WARN_UNUSED_VARIABLE = YES;
277 | MACOSX_DEPLOYMENT_TARGET = 10.15;
278 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
279 | MTL_FAST_MATH = YES;
280 | ONLY_ACTIVE_ARCH = YES;
281 | SDKROOT = macosx;
282 | };
283 | name = Debug;
284 | };
285 | 343E10C324859D980067F56C /* Release */ = {
286 | isa = XCBuildConfiguration;
287 | buildSettings = {
288 | ALWAYS_SEARCH_USER_PATHS = NO;
289 | CLANG_ANALYZER_NONNULL = YES;
290 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
291 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
292 | CLANG_CXX_LIBRARY = "libc++";
293 | CLANG_ENABLE_MODULES = YES;
294 | CLANG_ENABLE_OBJC_ARC = YES;
295 | CLANG_ENABLE_OBJC_WEAK = YES;
296 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
297 | CLANG_WARN_BOOL_CONVERSION = YES;
298 | CLANG_WARN_COMMA = YES;
299 | CLANG_WARN_CONSTANT_CONVERSION = YES;
300 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
301 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
302 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
303 | CLANG_WARN_EMPTY_BODY = YES;
304 | CLANG_WARN_ENUM_CONVERSION = YES;
305 | CLANG_WARN_INFINITE_RECURSION = YES;
306 | CLANG_WARN_INT_CONVERSION = YES;
307 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
308 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
309 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
310 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
311 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
312 | CLANG_WARN_STRICT_PROTOTYPES = YES;
313 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
314 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
315 | CLANG_WARN_UNREACHABLE_CODE = YES;
316 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
317 | COPY_PHASE_STRIP = NO;
318 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
319 | ENABLE_NS_ASSERTIONS = NO;
320 | ENABLE_STRICT_OBJC_MSGSEND = YES;
321 | GCC_C_LANGUAGE_STANDARD = gnu11;
322 | GCC_NO_COMMON_BLOCKS = YES;
323 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
324 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
325 | GCC_WARN_UNDECLARED_SELECTOR = YES;
326 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
327 | GCC_WARN_UNUSED_FUNCTION = YES;
328 | GCC_WARN_UNUSED_VARIABLE = YES;
329 | MACOSX_DEPLOYMENT_TARGET = 10.15;
330 | MTL_ENABLE_DEBUG_INFO = NO;
331 | MTL_FAST_MATH = YES;
332 | SDKROOT = macosx;
333 | };
334 | name = Release;
335 | };
336 | 343E10C524859D980067F56C /* Debug */ = {
337 | isa = XCBuildConfiguration;
338 | buildSettings = {
339 | CODE_SIGN_STYLE = Automatic;
340 | COMBINE_HIDPI_IMAGES = YES;
341 | HEADER_SEARCH_PATHS = "$PROJECT_DIR/tree-sitter-html/src";
342 | INFOPLIST_FILE = html/Info.plist;
343 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
344 | PRODUCT_BUNDLE_IDENTIFIER = io.github.viktorstrate.SwiftTreeSitter.language.html;
345 | PRODUCT_NAME = "$(TARGET_NAME)";
346 | SKIP_INSTALL = YES;
347 | SUPPORTED_PLATFORMS = "macosx iphoneos iphonesimulator";
348 | VALID_ARCHS = "i386 x86_64 arm64 armv7 armv7s";
349 | WRAPPER_EXTENSION = bundle;
350 | };
351 | name = Debug;
352 | };
353 | 343E10C624859D980067F56C /* Release */ = {
354 | isa = XCBuildConfiguration;
355 | buildSettings = {
356 | CODE_SIGN_STYLE = Automatic;
357 | COMBINE_HIDPI_IMAGES = YES;
358 | HEADER_SEARCH_PATHS = "$PROJECT_DIR/tree-sitter-html/src";
359 | INFOPLIST_FILE = html/Info.plist;
360 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
361 | PRODUCT_BUNDLE_IDENTIFIER = io.github.viktorstrate.SwiftTreeSitter.language.html;
362 | PRODUCT_NAME = "$(TARGET_NAME)";
363 | SKIP_INSTALL = YES;
364 | SUPPORTED_PLATFORMS = "macosx iphoneos iphonesimulator";
365 | VALID_ARCHS = "i386 x86_64 arm64 armv7 armv7s";
366 | WRAPPER_EXTENSION = bundle;
367 | };
368 | name = Release;
369 | };
370 | /* End XCBuildConfiguration section */
371 |
372 | /* Begin XCConfigurationList section */
373 | 343E10B924859D980067F56C /* Build configuration list for PBXProject "html" */ = {
374 | isa = XCConfigurationList;
375 | buildConfigurations = (
376 | 343E10C224859D980067F56C /* Debug */,
377 | 343E10C324859D980067F56C /* Release */,
378 | );
379 | defaultConfigurationIsVisible = 0;
380 | defaultConfigurationName = Release;
381 | };
382 | 343E10C424859D980067F56C /* Build configuration list for PBXNativeTarget "html" */ = {
383 | isa = XCConfigurationList;
384 | buildConfigurations = (
385 | 343E10C524859D980067F56C /* Debug */,
386 | 343E10C624859D980067F56C /* Release */,
387 | );
388 | defaultConfigurationIsVisible = 0;
389 | defaultConfigurationName = Release;
390 | };
391 | /* End XCConfigurationList section */
392 | };
393 | rootObject = 343E10B624859D980067F56C /* Project object */;
394 | }
395 |
--------------------------------------------------------------------------------
/languages/php/php.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 50;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 343E14842487AB3D0067F56C /* scanner.cc in Sources */ = {isa = PBXBuildFile; fileRef = 343E14672487AB3D0067F56C /* scanner.cc */; };
11 | 343E14852487AB3D0067F56C /* parser.c in Sources */ = {isa = PBXBuildFile; fileRef = 343E14682487AB3D0067F56C /* parser.c */; };
12 | 343E14872487AB6D0067F56C /* queries in Resources */ = {isa = PBXBuildFile; fileRef = 343E14862487AB6D0067F56C /* queries */; };
13 | /* End PBXBuildFile section */
14 |
15 | /* Begin PBXFileReference section */
16 | 343E10DC24859E8D0067F56C /* php.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = php.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
17 | 343E10E624859E9C0067F56C /* info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = info.plist; sourceTree = ""; };
18 | 343E14442487AB3D0067F56C /* .npmignore */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = .npmignore; sourceTree = ""; };
19 | 343E14452487AB3D0067F56C /* grammar.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = grammar.js; sourceTree = ""; };
20 | 343E14482487AB3D0067F56C /* keywords.php */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.php; path = keywords.php; sourceTree = ""; };
21 | 343E14492487AB3D0067F56C /* literals.php */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.php; path = literals.php; sourceTree = ""; };
22 | 343E144A2487AB3D0067F56C /* types.php */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.php; path = types.php; sourceTree = ""; };
23 | 343E144C2487AB3D0067F56C /* interpolation.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = interpolation.txt; sourceTree = ""; };
24 | 343E144D2487AB3D0067F56C /* literals.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = literals.txt; sourceTree = ""; };
25 | 343E144E2487AB3D0067F56C /* declarations.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = declarations.txt; sourceTree = ""; };
26 | 343E144F2487AB3D0067F56C /* statements.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = statements.txt; sourceTree = ""; };
27 | 343E14502487AB3D0067F56C /* types.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = types.txt; sourceTree = ""; };
28 | 343E14512487AB3D0067F56C /* expressions.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = expressions.txt; sourceTree = ""; };
29 | 343E14522487AB3D0067F56C /* binding.gyp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = binding.gyp; sourceTree = ""; };
30 | 343E14542487AB3D0067F56C /* tags.scm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tags.scm; sourceTree = ""; };
31 | 343E14552487AB3D0067F56C /* highlights.scm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = highlights.scm; sourceTree = ""; };
32 | 343E14562487AB3D0067F56C /* injections.scm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = injections.scm; sourceTree = ""; };
33 | 343E14572487AB3D0067F56C /* index.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = index.js; sourceTree = ""; };
34 | 343E14592487AB3D0067F56C /* known-failures.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "known-failures.txt"; sourceTree = ""; };
35 | 343E145A2487AB3D0067F56C /* parse-examples */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "parse-examples"; sourceTree = ""; };
36 | 343E145B2487AB3D0067F56C /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; };
37 | 343E145C2487AB3D0067F56C /* appveyor.yml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.yaml; path = appveyor.yml; sourceTree = ""; };
38 | 343E145D2487AB3D0067F56C /* .gitignore */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = .gitignore; sourceTree = ""; };
39 | 343E145E2487AB3D0067F56C /* package.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = package.json; sourceTree = ""; };
40 | 343E145F2487AB3D0067F56C /* .gitattributes */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = .gitattributes; sourceTree = ""; };
41 | 343E14602487AB3D0067F56C /* .travis.yml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.yaml; path = .travis.yml; sourceTree = ""; };
42 | 343E14622487AB3D0067F56C /* binding.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = binding.cc; sourceTree = ""; };
43 | 343E14632487AB3D0067F56C /* node-types.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "node-types.json"; sourceTree = ""; };
44 | 343E14652487AB3D0067F56C /* parser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = parser.h; sourceTree = ""; };
45 | 343E14662487AB3D0067F56C /* grammar.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = grammar.json; sourceTree = ""; };
46 | 343E14672487AB3D0067F56C /* scanner.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = scanner.cc; sourceTree = ""; };
47 | 343E14682487AB3D0067F56C /* parser.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = parser.c; sourceTree = ""; };
48 | 343E14862487AB6D0067F56C /* queries */ = {isa = PBXFileReference; lastKnownFileType = folder; name = queries; path = "tree-sitter-php/queries"; sourceTree = ""; };
49 | /* End PBXFileReference section */
50 |
51 | /* Begin PBXFrameworksBuildPhase section */
52 | 343E10D924859E8D0067F56C /* Frameworks */ = {
53 | isa = PBXFrameworksBuildPhase;
54 | buildActionMask = 2147483647;
55 | files = (
56 | );
57 | runOnlyForDeploymentPostprocessing = 0;
58 | };
59 | /* End PBXFrameworksBuildPhase section */
60 |
61 | /* Begin PBXGroup section */
62 | 343E10D324859E8D0067F56C = {
63 | isa = PBXGroup;
64 | children = (
65 | 343E14862487AB6D0067F56C /* queries */,
66 | 343E14432487AB3D0067F56C /* tree-sitter-php */,
67 | 343E10DE24859E8D0067F56C /* php */,
68 | 343E10DD24859E8D0067F56C /* Products */,
69 | );
70 | sourceTree = "";
71 | };
72 | 343E10DD24859E8D0067F56C /* Products */ = {
73 | isa = PBXGroup;
74 | children = (
75 | 343E10DC24859E8D0067F56C /* php.bundle */,
76 | );
77 | name = Products;
78 | sourceTree = "";
79 | };
80 | 343E10DE24859E8D0067F56C /* php */ = {
81 | isa = PBXGroup;
82 | children = (
83 | 343E10E624859E9C0067F56C /* info.plist */,
84 | );
85 | path = php;
86 | sourceTree = "";
87 | };
88 | 343E14432487AB3D0067F56C /* tree-sitter-php */ = {
89 | isa = PBXGroup;
90 | children = (
91 | 343E14442487AB3D0067F56C /* .npmignore */,
92 | 343E14452487AB3D0067F56C /* grammar.js */,
93 | 343E14462487AB3D0067F56C /* test */,
94 | 343E14522487AB3D0067F56C /* binding.gyp */,
95 | 343E14532487AB3D0067F56C /* queries */,
96 | 343E14572487AB3D0067F56C /* index.js */,
97 | 343E14582487AB3D0067F56C /* script */,
98 | 343E145B2487AB3D0067F56C /* README.md */,
99 | 343E145C2487AB3D0067F56C /* appveyor.yml */,
100 | 343E145D2487AB3D0067F56C /* .gitignore */,
101 | 343E145E2487AB3D0067F56C /* package.json */,
102 | 343E145F2487AB3D0067F56C /* .gitattributes */,
103 | 343E14602487AB3D0067F56C /* .travis.yml */,
104 | 343E14612487AB3D0067F56C /* src */,
105 | );
106 | path = "tree-sitter-php";
107 | sourceTree = "";
108 | };
109 | 343E14462487AB3D0067F56C /* test */ = {
110 | isa = PBXGroup;
111 | children = (
112 | 343E14472487AB3D0067F56C /* highlight */,
113 | 343E144B2487AB3D0067F56C /* corpus */,
114 | );
115 | path = test;
116 | sourceTree = "";
117 | };
118 | 343E14472487AB3D0067F56C /* highlight */ = {
119 | isa = PBXGroup;
120 | children = (
121 | 343E14482487AB3D0067F56C /* keywords.php */,
122 | 343E14492487AB3D0067F56C /* literals.php */,
123 | 343E144A2487AB3D0067F56C /* types.php */,
124 | );
125 | path = highlight;
126 | sourceTree = "";
127 | };
128 | 343E144B2487AB3D0067F56C /* corpus */ = {
129 | isa = PBXGroup;
130 | children = (
131 | 343E144C2487AB3D0067F56C /* interpolation.txt */,
132 | 343E144D2487AB3D0067F56C /* literals.txt */,
133 | 343E144E2487AB3D0067F56C /* declarations.txt */,
134 | 343E144F2487AB3D0067F56C /* statements.txt */,
135 | 343E14502487AB3D0067F56C /* types.txt */,
136 | 343E14512487AB3D0067F56C /* expressions.txt */,
137 | );
138 | path = corpus;
139 | sourceTree = "";
140 | };
141 | 343E14532487AB3D0067F56C /* queries */ = {
142 | isa = PBXGroup;
143 | children = (
144 | 343E14542487AB3D0067F56C /* tags.scm */,
145 | 343E14552487AB3D0067F56C /* highlights.scm */,
146 | 343E14562487AB3D0067F56C /* injections.scm */,
147 | );
148 | path = queries;
149 | sourceTree = "";
150 | };
151 | 343E14582487AB3D0067F56C /* script */ = {
152 | isa = PBXGroup;
153 | children = (
154 | 343E14592487AB3D0067F56C /* known-failures.txt */,
155 | 343E145A2487AB3D0067F56C /* parse-examples */,
156 | );
157 | path = script;
158 | sourceTree = "";
159 | };
160 | 343E14612487AB3D0067F56C /* src */ = {
161 | isa = PBXGroup;
162 | children = (
163 | 343E14622487AB3D0067F56C /* binding.cc */,
164 | 343E14632487AB3D0067F56C /* node-types.json */,
165 | 343E14642487AB3D0067F56C /* tree_sitter */,
166 | 343E14662487AB3D0067F56C /* grammar.json */,
167 | 343E14672487AB3D0067F56C /* scanner.cc */,
168 | 343E14682487AB3D0067F56C /* parser.c */,
169 | );
170 | path = src;
171 | sourceTree = "";
172 | };
173 | 343E14642487AB3D0067F56C /* tree_sitter */ = {
174 | isa = PBXGroup;
175 | children = (
176 | 343E14652487AB3D0067F56C /* parser.h */,
177 | );
178 | path = tree_sitter;
179 | sourceTree = "";
180 | };
181 | /* End PBXGroup section */
182 |
183 | /* Begin PBXNativeTarget section */
184 | 343E10DB24859E8D0067F56C /* php */ = {
185 | isa = PBXNativeTarget;
186 | buildConfigurationList = 343E10E224859E8D0067F56C /* Build configuration list for PBXNativeTarget "php" */;
187 | buildPhases = (
188 | 343E10D824859E8D0067F56C /* Sources */,
189 | 343E10D924859E8D0067F56C /* Frameworks */,
190 | 343E10DA24859E8D0067F56C /* Resources */,
191 | );
192 | buildRules = (
193 | );
194 | dependencies = (
195 | );
196 | name = php;
197 | productName = php;
198 | productReference = 343E10DC24859E8D0067F56C /* php.bundle */;
199 | productType = "com.apple.product-type.bundle";
200 | };
201 | /* End PBXNativeTarget section */
202 |
203 | /* Begin PBXProject section */
204 | 343E10D424859E8D0067F56C /* Project object */ = {
205 | isa = PBXProject;
206 | attributes = {
207 | LastUpgradeCheck = 1150;
208 | ORGANIZATIONNAME = viktorstrate;
209 | TargetAttributes = {
210 | 343E10DB24859E8D0067F56C = {
211 | CreatedOnToolsVersion = 11.5;
212 | };
213 | };
214 | };
215 | buildConfigurationList = 343E10D724859E8D0067F56C /* Build configuration list for PBXProject "php" */;
216 | compatibilityVersion = "Xcode 9.3";
217 | developmentRegion = en;
218 | hasScannedForEncodings = 0;
219 | knownRegions = (
220 | en,
221 | Base,
222 | );
223 | mainGroup = 343E10D324859E8D0067F56C;
224 | productRefGroup = 343E10DD24859E8D0067F56C /* Products */;
225 | projectDirPath = "";
226 | projectRoot = "";
227 | targets = (
228 | 343E10DB24859E8D0067F56C /* php */,
229 | );
230 | };
231 | /* End PBXProject section */
232 |
233 | /* Begin PBXResourcesBuildPhase section */
234 | 343E10DA24859E8D0067F56C /* Resources */ = {
235 | isa = PBXResourcesBuildPhase;
236 | buildActionMask = 2147483647;
237 | files = (
238 | 343E14872487AB6D0067F56C /* queries in Resources */,
239 | );
240 | runOnlyForDeploymentPostprocessing = 0;
241 | };
242 | /* End PBXResourcesBuildPhase section */
243 |
244 | /* Begin PBXSourcesBuildPhase section */
245 | 343E10D824859E8D0067F56C /* Sources */ = {
246 | isa = PBXSourcesBuildPhase;
247 | buildActionMask = 2147483647;
248 | files = (
249 | 343E14842487AB3D0067F56C /* scanner.cc in Sources */,
250 | 343E14852487AB3D0067F56C /* parser.c in Sources */,
251 | );
252 | runOnlyForDeploymentPostprocessing = 0;
253 | };
254 | /* End PBXSourcesBuildPhase section */
255 |
256 | /* Begin XCBuildConfiguration section */
257 | 343E10E024859E8D0067F56C /* Debug */ = {
258 | isa = XCBuildConfiguration;
259 | buildSettings = {
260 | ALWAYS_SEARCH_USER_PATHS = NO;
261 | CLANG_ANALYZER_NONNULL = YES;
262 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
263 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
264 | CLANG_CXX_LIBRARY = "libc++";
265 | CLANG_ENABLE_MODULES = YES;
266 | CLANG_ENABLE_OBJC_ARC = YES;
267 | CLANG_ENABLE_OBJC_WEAK = YES;
268 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
269 | CLANG_WARN_BOOL_CONVERSION = YES;
270 | CLANG_WARN_COMMA = YES;
271 | CLANG_WARN_CONSTANT_CONVERSION = YES;
272 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
273 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
274 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
275 | CLANG_WARN_EMPTY_BODY = YES;
276 | CLANG_WARN_ENUM_CONVERSION = YES;
277 | CLANG_WARN_INFINITE_RECURSION = YES;
278 | CLANG_WARN_INT_CONVERSION = YES;
279 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
280 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
281 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
282 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
283 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
284 | CLANG_WARN_STRICT_PROTOTYPES = YES;
285 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
286 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
287 | CLANG_WARN_UNREACHABLE_CODE = YES;
288 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
289 | COPY_PHASE_STRIP = NO;
290 | DEBUG_INFORMATION_FORMAT = dwarf;
291 | ENABLE_STRICT_OBJC_MSGSEND = YES;
292 | ENABLE_TESTABILITY = YES;
293 | GCC_C_LANGUAGE_STANDARD = gnu11;
294 | GCC_DYNAMIC_NO_PIC = NO;
295 | GCC_NO_COMMON_BLOCKS = YES;
296 | GCC_OPTIMIZATION_LEVEL = 0;
297 | GCC_PREPROCESSOR_DEFINITIONS = (
298 | "DEBUG=1",
299 | "$(inherited)",
300 | );
301 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
302 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
303 | GCC_WARN_UNDECLARED_SELECTOR = YES;
304 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
305 | GCC_WARN_UNUSED_FUNCTION = YES;
306 | GCC_WARN_UNUSED_VARIABLE = YES;
307 | MACOSX_DEPLOYMENT_TARGET = 10.15;
308 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
309 | MTL_FAST_MATH = YES;
310 | ONLY_ACTIVE_ARCH = YES;
311 | SDKROOT = macosx;
312 | };
313 | name = Debug;
314 | };
315 | 343E10E124859E8D0067F56C /* Release */ = {
316 | isa = XCBuildConfiguration;
317 | buildSettings = {
318 | ALWAYS_SEARCH_USER_PATHS = NO;
319 | CLANG_ANALYZER_NONNULL = YES;
320 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
321 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
322 | CLANG_CXX_LIBRARY = "libc++";
323 | CLANG_ENABLE_MODULES = YES;
324 | CLANG_ENABLE_OBJC_ARC = YES;
325 | CLANG_ENABLE_OBJC_WEAK = YES;
326 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
327 | CLANG_WARN_BOOL_CONVERSION = YES;
328 | CLANG_WARN_COMMA = YES;
329 | CLANG_WARN_CONSTANT_CONVERSION = YES;
330 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
331 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
332 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
333 | CLANG_WARN_EMPTY_BODY = YES;
334 | CLANG_WARN_ENUM_CONVERSION = YES;
335 | CLANG_WARN_INFINITE_RECURSION = YES;
336 | CLANG_WARN_INT_CONVERSION = YES;
337 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
338 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
339 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
340 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
341 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
342 | CLANG_WARN_STRICT_PROTOTYPES = YES;
343 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
344 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
345 | CLANG_WARN_UNREACHABLE_CODE = YES;
346 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
347 | COPY_PHASE_STRIP = NO;
348 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
349 | ENABLE_NS_ASSERTIONS = NO;
350 | ENABLE_STRICT_OBJC_MSGSEND = YES;
351 | GCC_C_LANGUAGE_STANDARD = gnu11;
352 | GCC_NO_COMMON_BLOCKS = YES;
353 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
354 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
355 | GCC_WARN_UNDECLARED_SELECTOR = YES;
356 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
357 | GCC_WARN_UNUSED_FUNCTION = YES;
358 | GCC_WARN_UNUSED_VARIABLE = YES;
359 | MACOSX_DEPLOYMENT_TARGET = 10.15;
360 | MTL_ENABLE_DEBUG_INFO = NO;
361 | MTL_FAST_MATH = YES;
362 | SDKROOT = macosx;
363 | };
364 | name = Release;
365 | };
366 | 343E10E324859E8D0067F56C /* Debug */ = {
367 | isa = XCBuildConfiguration;
368 | buildSettings = {
369 | CODE_SIGN_STYLE = Automatic;
370 | COMBINE_HIDPI_IMAGES = YES;
371 | HEADER_SEARCH_PATHS = "$PROJECT_DIR/tree-sitter-php/src";
372 | INFOPLIST_FILE = php/Info.plist;
373 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
374 | PRODUCT_BUNDLE_IDENTIFIER = io.github.viktorstrate.SwiftTreeSitter.language.php;
375 | PRODUCT_NAME = "$(TARGET_NAME)";
376 | SKIP_INSTALL = YES;
377 | SUPPORTED_PLATFORMS = "macosx iphoneos iphonesimulator";
378 | VALID_ARCHS = "i386 x86_64 arm64 armv7 armv7s";
379 | WRAPPER_EXTENSION = bundle;
380 | };
381 | name = Debug;
382 | };
383 | 343E10E424859E8D0067F56C /* Release */ = {
384 | isa = XCBuildConfiguration;
385 | buildSettings = {
386 | CODE_SIGN_STYLE = Automatic;
387 | COMBINE_HIDPI_IMAGES = YES;
388 | HEADER_SEARCH_PATHS = "$PROJECT_DIR/tree-sitter-php/src";
389 | INFOPLIST_FILE = php/Info.plist;
390 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
391 | PRODUCT_BUNDLE_IDENTIFIER = io.github.viktorstrate.SwiftTreeSitter.language.php;
392 | PRODUCT_NAME = "$(TARGET_NAME)";
393 | SKIP_INSTALL = YES;
394 | SUPPORTED_PLATFORMS = "macosx iphoneos iphonesimulator";
395 | VALID_ARCHS = "i386 x86_64 arm64 armv7 armv7s";
396 | WRAPPER_EXTENSION = bundle;
397 | };
398 | name = Release;
399 | };
400 | /* End XCBuildConfiguration section */
401 |
402 | /* Begin XCConfigurationList section */
403 | 343E10D724859E8D0067F56C /* Build configuration list for PBXProject "php" */ = {
404 | isa = XCConfigurationList;
405 | buildConfigurations = (
406 | 343E10E024859E8D0067F56C /* Debug */,
407 | 343E10E124859E8D0067F56C /* Release */,
408 | );
409 | defaultConfigurationIsVisible = 0;
410 | defaultConfigurationName = Release;
411 | };
412 | 343E10E224859E8D0067F56C /* Build configuration list for PBXNativeTarget "php" */ = {
413 | isa = XCConfigurationList;
414 | buildConfigurations = (
415 | 343E10E324859E8D0067F56C /* Debug */,
416 | 343E10E424859E8D0067F56C /* Release */,
417 | );
418 | defaultConfigurationIsVisible = 0;
419 | defaultConfigurationName = Release;
420 | };
421 | /* End XCConfigurationList section */
422 | };
423 | rootObject = 343E10D424859E8D0067F56C /* Project object */;
424 | }
425 |
--------------------------------------------------------------------------------
/languages/javascript/javascript.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 50;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 343E12B92487A2C50067F56C /* scanner.c in Sources */ = {isa = PBXBuildFile; fileRef = 343E12952487A2C50067F56C /* scanner.c */; };
11 | 343E12C62487A3120067F56C /* queries in Resources */ = {isa = PBXBuildFile; fileRef = 343E12C52487A3120067F56C /* queries */; };
12 | 343E133D2487A77C0067F56C /* parser.c in Sources */ = {isa = PBXBuildFile; fileRef = 343E133C2487A77B0067F56C /* parser.c */; };
13 | /* End PBXBuildFile section */
14 |
15 | /* Begin PBXFileReference section */
16 | 341784B8247FD24800843085 /* javascript.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = javascript.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
17 | 341784BB247FD24800843085 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
18 | 343E12712487A2C50067F56C /* .npmignore */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = .npmignore; sourceTree = ""; };
19 | 343E12722487A2C50067F56C /* grammar.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = grammar.js; sourceTree = ""; };
20 | 343E12732487A2C50067F56C /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = ""; };
21 | 343E12762487A2C50067F56C /* keywords.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = keywords.js; sourceTree = ""; };
22 | 343E12772487A2C50067F56C /* variables.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = variables.js; sourceTree = ""; };
23 | 343E12782487A2C50067F56C /* functions.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = functions.js; sourceTree = ""; };
24 | 343E127A2487A2C50067F56C /* literals.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = literals.txt; sourceTree = ""; };
25 | 343E127B2487A2C50067F56C /* statements.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = statements.txt; sourceTree = ""; };
26 | 343E127C2487A2C50067F56C /* destructuring.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = destructuring.txt; sourceTree = ""; };
27 | 343E127D2487A2C50067F56C /* expressions.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = expressions.txt; sourceTree = ""; };
28 | 343E127E2487A2C50067F56C /* semicolon_insertion.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = semicolon_insertion.txt; sourceTree = ""; };
29 | 343E127F2487A2C50067F56C /* binding.gyp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = binding.gyp; sourceTree = ""; };
30 | 343E12812487A2C50067F56C /* tags.scm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tags.scm; sourceTree = ""; };
31 | 343E12822487A2C50067F56C /* locals.scm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = locals.scm; sourceTree = ""; };
32 | 343E12832487A2C50067F56C /* highlights.scm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = highlights.scm; sourceTree = ""; };
33 | 343E12842487A2C50067F56C /* highlights-jsx.scm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "highlights-jsx.scm"; sourceTree = ""; };
34 | 343E12852487A2C50067F56C /* injections.scm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = injections.scm; sourceTree = ""; };
35 | 343E12862487A2C50067F56C /* index.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = index.js; sourceTree = ""; };
36 | 343E12882487A2C50067F56C /* known_failures.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = known_failures.txt; sourceTree = ""; };
37 | 343E12892487A2C50067F56C /* benchmark.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = benchmark.js; sourceTree = ""; };
38 | 343E128A2487A2C50067F56C /* parse-examples */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "parse-examples"; sourceTree = ""; };
39 | 343E128B2487A2C50067F56C /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; };
40 | 343E128C2487A2C50067F56C /* appveyor.yml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.yaml; path = appveyor.yml; sourceTree = ""; };
41 | 343E128D2487A2C50067F56C /* .gitignore */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = .gitignore; sourceTree = ""; };
42 | 343E128E2487A2C50067F56C /* package.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = package.json; sourceTree = ""; };
43 | 343E12902487A2C50067F56C /* text-editor-component.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "text-editor-component.js"; sourceTree = ""; };
44 | 343E12912487A2C50067F56C /* jquery.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = jquery.js; sourceTree = ""; };
45 | 343E12922487A2C50067F56C /* .gitattributes */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = .gitattributes; sourceTree = ""; };
46 | 343E12932487A2C50067F56C /* .travis.yml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.yaml; path = .travis.yml; sourceTree = ""; };
47 | 343E12952487A2C50067F56C /* scanner.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = scanner.c; sourceTree = ""; };
48 | 343E12962487A2C50067F56C /* binding.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = binding.cc; sourceTree = ""; };
49 | 343E12972487A2C50067F56C /* node-types.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "node-types.json"; sourceTree = ""; };
50 | 343E12992487A2C50067F56C /* parser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = parser.h; sourceTree = ""; };
51 | 343E129A2487A2C50067F56C /* grammar.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = grammar.json; sourceTree = ""; };
52 | 343E129B2487A2C50067F56C /* parser.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = parser.c; sourceTree = ""; };
53 | 343E12C52487A3120067F56C /* queries */ = {isa = PBXFileReference; lastKnownFileType = folder; name = queries; path = "tree-sitter-javascript/queries"; sourceTree = ""; };
54 | 343E133C2487A77B0067F56C /* parser.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = parser.c; path = "tree-sitter-javascript/src/parser.c"; sourceTree = ""; };
55 | /* End PBXFileReference section */
56 |
57 | /* Begin PBXFrameworksBuildPhase section */
58 | 343E12C72487A6410067F56C /* Frameworks */ = {
59 | isa = PBXFrameworksBuildPhase;
60 | buildActionMask = 2147483647;
61 | files = (
62 | );
63 | runOnlyForDeploymentPostprocessing = 0;
64 | };
65 | /* End PBXFrameworksBuildPhase section */
66 |
67 | /* Begin PBXGroup section */
68 | 341784AF247FD24800843085 = {
69 | isa = PBXGroup;
70 | children = (
71 | 343E133C2487A77B0067F56C /* parser.c */,
72 | 343E12C52487A3120067F56C /* queries */,
73 | 343E12702487A2C50067F56C /* tree-sitter-javascript */,
74 | 341784BA247FD24800843085 /* javascript */,
75 | 341784B9247FD24800843085 /* Products */,
76 | );
77 | sourceTree = "";
78 | };
79 | 341784B9247FD24800843085 /* Products */ = {
80 | isa = PBXGroup;
81 | children = (
82 | 341784B8247FD24800843085 /* javascript.bundle */,
83 | );
84 | name = Products;
85 | sourceTree = "";
86 | };
87 | 341784BA247FD24800843085 /* javascript */ = {
88 | isa = PBXGroup;
89 | children = (
90 | 341784BB247FD24800843085 /* Info.plist */,
91 | );
92 | path = javascript;
93 | sourceTree = "";
94 | };
95 | 343E12702487A2C50067F56C /* tree-sitter-javascript */ = {
96 | isa = PBXGroup;
97 | children = (
98 | 343E12712487A2C50067F56C /* .npmignore */,
99 | 343E12722487A2C50067F56C /* grammar.js */,
100 | 343E12732487A2C50067F56C /* LICENSE */,
101 | 343E12742487A2C50067F56C /* test */,
102 | 343E127F2487A2C50067F56C /* binding.gyp */,
103 | 343E12802487A2C50067F56C /* queries */,
104 | 343E12862487A2C50067F56C /* index.js */,
105 | 343E12872487A2C50067F56C /* script */,
106 | 343E128B2487A2C50067F56C /* README.md */,
107 | 343E128C2487A2C50067F56C /* appveyor.yml */,
108 | 343E128D2487A2C50067F56C /* .gitignore */,
109 | 343E128E2487A2C50067F56C /* package.json */,
110 | 343E128F2487A2C50067F56C /* examples */,
111 | 343E12922487A2C50067F56C /* .gitattributes */,
112 | 343E12932487A2C50067F56C /* .travis.yml */,
113 | 343E12942487A2C50067F56C /* src */,
114 | );
115 | path = "tree-sitter-javascript";
116 | sourceTree = "";
117 | };
118 | 343E12742487A2C50067F56C /* test */ = {
119 | isa = PBXGroup;
120 | children = (
121 | 343E12752487A2C50067F56C /* highlight */,
122 | 343E12792487A2C50067F56C /* corpus */,
123 | );
124 | path = test;
125 | sourceTree = "";
126 | };
127 | 343E12752487A2C50067F56C /* highlight */ = {
128 | isa = PBXGroup;
129 | children = (
130 | 343E12762487A2C50067F56C /* keywords.js */,
131 | 343E12772487A2C50067F56C /* variables.js */,
132 | 343E12782487A2C50067F56C /* functions.js */,
133 | );
134 | path = highlight;
135 | sourceTree = "";
136 | };
137 | 343E12792487A2C50067F56C /* corpus */ = {
138 | isa = PBXGroup;
139 | children = (
140 | 343E127A2487A2C50067F56C /* literals.txt */,
141 | 343E127B2487A2C50067F56C /* statements.txt */,
142 | 343E127C2487A2C50067F56C /* destructuring.txt */,
143 | 343E127D2487A2C50067F56C /* expressions.txt */,
144 | 343E127E2487A2C50067F56C /* semicolon_insertion.txt */,
145 | );
146 | path = corpus;
147 | sourceTree = "";
148 | };
149 | 343E12802487A2C50067F56C /* queries */ = {
150 | isa = PBXGroup;
151 | children = (
152 | 343E12812487A2C50067F56C /* tags.scm */,
153 | 343E12822487A2C50067F56C /* locals.scm */,
154 | 343E12832487A2C50067F56C /* highlights.scm */,
155 | 343E12842487A2C50067F56C /* highlights-jsx.scm */,
156 | 343E12852487A2C50067F56C /* injections.scm */,
157 | );
158 | path = queries;
159 | sourceTree = "";
160 | };
161 | 343E12872487A2C50067F56C /* script */ = {
162 | isa = PBXGroup;
163 | children = (
164 | 343E12882487A2C50067F56C /* known_failures.txt */,
165 | 343E12892487A2C50067F56C /* benchmark.js */,
166 | 343E128A2487A2C50067F56C /* parse-examples */,
167 | );
168 | path = script;
169 | sourceTree = "";
170 | };
171 | 343E128F2487A2C50067F56C /* examples */ = {
172 | isa = PBXGroup;
173 | children = (
174 | 343E12902487A2C50067F56C /* text-editor-component.js */,
175 | 343E12912487A2C50067F56C /* jquery.js */,
176 | );
177 | path = examples;
178 | sourceTree = "";
179 | };
180 | 343E12942487A2C50067F56C /* src */ = {
181 | isa = PBXGroup;
182 | children = (
183 | 343E12952487A2C50067F56C /* scanner.c */,
184 | 343E12962487A2C50067F56C /* binding.cc */,
185 | 343E12972487A2C50067F56C /* node-types.json */,
186 | 343E12982487A2C50067F56C /* tree_sitter */,
187 | 343E129A2487A2C50067F56C /* grammar.json */,
188 | 343E129B2487A2C50067F56C /* parser.c */,
189 | );
190 | path = src;
191 | sourceTree = "";
192 | };
193 | 343E12982487A2C50067F56C /* tree_sitter */ = {
194 | isa = PBXGroup;
195 | children = (
196 | 343E12992487A2C50067F56C /* parser.h */,
197 | );
198 | path = tree_sitter;
199 | sourceTree = "";
200 | };
201 | /* End PBXGroup section */
202 |
203 | /* Begin PBXHeadersBuildPhase section */
204 | 341784D0247FD2B500843085 /* Headers */ = {
205 | isa = PBXHeadersBuildPhase;
206 | buildActionMask = 2147483647;
207 | files = (
208 | );
209 | runOnlyForDeploymentPostprocessing = 0;
210 | };
211 | /* End PBXHeadersBuildPhase section */
212 |
213 | /* Begin PBXNativeTarget section */
214 | 341784B7247FD24800843085 /* javascript */ = {
215 | isa = PBXNativeTarget;
216 | buildConfigurationList = 341784BE247FD24800843085 /* Build configuration list for PBXNativeTarget "javascript" */;
217 | buildPhases = (
218 | 341784D0247FD2B500843085 /* Headers */,
219 | 341784B4247FD24800843085 /* Sources */,
220 | 343E12C72487A6410067F56C /* Frameworks */,
221 | 341784B6247FD24800843085 /* Resources */,
222 | );
223 | buildRules = (
224 | );
225 | dependencies = (
226 | );
227 | name = javascript;
228 | productName = javascript;
229 | productReference = 341784B8247FD24800843085 /* javascript.bundle */;
230 | productType = "com.apple.product-type.bundle";
231 | };
232 | /* End PBXNativeTarget section */
233 |
234 | /* Begin PBXProject section */
235 | 341784B0247FD24800843085 /* Project object */ = {
236 | isa = PBXProject;
237 | attributes = {
238 | LastUpgradeCheck = 1150;
239 | ORGANIZATIONNAME = viktorstrate;
240 | TargetAttributes = {
241 | 341784B7247FD24800843085 = {
242 | CreatedOnToolsVersion = 11.5;
243 | };
244 | };
245 | };
246 | buildConfigurationList = 341784B3247FD24800843085 /* Build configuration list for PBXProject "javascript" */;
247 | compatibilityVersion = "Xcode 9.3";
248 | developmentRegion = en;
249 | hasScannedForEncodings = 0;
250 | knownRegions = (
251 | en,
252 | Base,
253 | );
254 | mainGroup = 341784AF247FD24800843085;
255 | productRefGroup = 341784B9247FD24800843085 /* Products */;
256 | projectDirPath = "";
257 | projectRoot = "";
258 | targets = (
259 | 341784B7247FD24800843085 /* javascript */,
260 | );
261 | };
262 | /* End PBXProject section */
263 |
264 | /* Begin PBXResourcesBuildPhase section */
265 | 341784B6247FD24800843085 /* Resources */ = {
266 | isa = PBXResourcesBuildPhase;
267 | buildActionMask = 2147483647;
268 | files = (
269 | 343E12C62487A3120067F56C /* queries in Resources */,
270 | );
271 | runOnlyForDeploymentPostprocessing = 0;
272 | };
273 | /* End PBXResourcesBuildPhase section */
274 |
275 | /* Begin PBXSourcesBuildPhase section */
276 | 341784B4247FD24800843085 /* Sources */ = {
277 | isa = PBXSourcesBuildPhase;
278 | buildActionMask = 2147483647;
279 | files = (
280 | 343E12B92487A2C50067F56C /* scanner.c in Sources */,
281 | 343E133D2487A77C0067F56C /* parser.c in Sources */,
282 | );
283 | runOnlyForDeploymentPostprocessing = 0;
284 | };
285 | /* End PBXSourcesBuildPhase section */
286 |
287 | /* Begin XCBuildConfiguration section */
288 | 341784BC247FD24800843085 /* Debug */ = {
289 | isa = XCBuildConfiguration;
290 | buildSettings = {
291 | ALWAYS_SEARCH_USER_PATHS = NO;
292 | CLANG_ANALYZER_NONNULL = YES;
293 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
294 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
295 | CLANG_CXX_LIBRARY = "libc++";
296 | CLANG_ENABLE_MODULES = YES;
297 | CLANG_ENABLE_OBJC_ARC = YES;
298 | CLANG_ENABLE_OBJC_WEAK = YES;
299 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
300 | CLANG_WARN_BOOL_CONVERSION = YES;
301 | CLANG_WARN_COMMA = YES;
302 | CLANG_WARN_CONSTANT_CONVERSION = YES;
303 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
304 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
305 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
306 | CLANG_WARN_EMPTY_BODY = YES;
307 | CLANG_WARN_ENUM_CONVERSION = YES;
308 | CLANG_WARN_INFINITE_RECURSION = YES;
309 | CLANG_WARN_INT_CONVERSION = YES;
310 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
311 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
312 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
313 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
314 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
315 | CLANG_WARN_STRICT_PROTOTYPES = YES;
316 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
317 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
318 | CLANG_WARN_UNREACHABLE_CODE = YES;
319 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
320 | COPY_PHASE_STRIP = NO;
321 | DEBUG_INFORMATION_FORMAT = dwarf;
322 | ENABLE_STRICT_OBJC_MSGSEND = YES;
323 | ENABLE_TESTABILITY = YES;
324 | GCC_C_LANGUAGE_STANDARD = gnu11;
325 | GCC_DYNAMIC_NO_PIC = NO;
326 | GCC_NO_COMMON_BLOCKS = YES;
327 | GCC_OPTIMIZATION_LEVEL = 0;
328 | GCC_PREPROCESSOR_DEFINITIONS = (
329 | "DEBUG=1",
330 | "$(inherited)",
331 | );
332 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
333 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
334 | GCC_WARN_UNDECLARED_SELECTOR = YES;
335 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
336 | GCC_WARN_UNUSED_FUNCTION = YES;
337 | GCC_WARN_UNUSED_VARIABLE = YES;
338 | MACOSX_DEPLOYMENT_TARGET = 10.15;
339 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
340 | MTL_FAST_MATH = YES;
341 | ONLY_ACTIVE_ARCH = YES;
342 | SDKROOT = macosx;
343 | };
344 | name = Debug;
345 | };
346 | 341784BD247FD24800843085 /* Release */ = {
347 | isa = XCBuildConfiguration;
348 | buildSettings = {
349 | ALWAYS_SEARCH_USER_PATHS = NO;
350 | CLANG_ANALYZER_NONNULL = YES;
351 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
352 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
353 | CLANG_CXX_LIBRARY = "libc++";
354 | CLANG_ENABLE_MODULES = YES;
355 | CLANG_ENABLE_OBJC_ARC = YES;
356 | CLANG_ENABLE_OBJC_WEAK = YES;
357 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
358 | CLANG_WARN_BOOL_CONVERSION = YES;
359 | CLANG_WARN_COMMA = YES;
360 | CLANG_WARN_CONSTANT_CONVERSION = YES;
361 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
362 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
363 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
364 | CLANG_WARN_EMPTY_BODY = YES;
365 | CLANG_WARN_ENUM_CONVERSION = YES;
366 | CLANG_WARN_INFINITE_RECURSION = YES;
367 | CLANG_WARN_INT_CONVERSION = YES;
368 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
369 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
370 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
371 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
372 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
373 | CLANG_WARN_STRICT_PROTOTYPES = YES;
374 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
375 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
376 | CLANG_WARN_UNREACHABLE_CODE = YES;
377 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
378 | COPY_PHASE_STRIP = NO;
379 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
380 | ENABLE_NS_ASSERTIONS = NO;
381 | ENABLE_STRICT_OBJC_MSGSEND = YES;
382 | GCC_C_LANGUAGE_STANDARD = gnu11;
383 | GCC_NO_COMMON_BLOCKS = YES;
384 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
385 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
386 | GCC_WARN_UNDECLARED_SELECTOR = YES;
387 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
388 | GCC_WARN_UNUSED_FUNCTION = YES;
389 | GCC_WARN_UNUSED_VARIABLE = YES;
390 | MACOSX_DEPLOYMENT_TARGET = 10.15;
391 | MTL_ENABLE_DEBUG_INFO = NO;
392 | MTL_FAST_MATH = YES;
393 | SDKROOT = macosx;
394 | };
395 | name = Release;
396 | };
397 | 341784BF247FD24800843085 /* Debug */ = {
398 | isa = XCBuildConfiguration;
399 | buildSettings = {
400 | CODE_SIGN_STYLE = Automatic;
401 | COMBINE_HIDPI_IMAGES = YES;
402 | HEADER_SEARCH_PATHS = "$PROJECT_DIR/tree-sitter-javascript/src";
403 | INFOPLIST_FILE = javascript/Info.plist;
404 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
405 | PRODUCT_BUNDLE_IDENTIFIER = io.github.viktorstrate.SwiftTreeSitter.language.javascript;
406 | PRODUCT_NAME = "$(TARGET_NAME)";
407 | SKIP_INSTALL = YES;
408 | SUPPORTED_PLATFORMS = "macosx iphoneos iphonesimulator";
409 | VALID_ARCHS = "i386 x86_64 arm64 armv7 armv7s";
410 | WRAPPER_EXTENSION = bundle;
411 | };
412 | name = Debug;
413 | };
414 | 341784C0247FD24800843085 /* Release */ = {
415 | isa = XCBuildConfiguration;
416 | buildSettings = {
417 | CODE_SIGN_STYLE = Automatic;
418 | COMBINE_HIDPI_IMAGES = YES;
419 | HEADER_SEARCH_PATHS = "$PROJECT_DIR/tree-sitter-javascript/src";
420 | INFOPLIST_FILE = javascript/Info.plist;
421 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
422 | PRODUCT_BUNDLE_IDENTIFIER = io.github.viktorstrate.SwiftTreeSitter.language.javascript;
423 | PRODUCT_NAME = "$(TARGET_NAME)";
424 | SKIP_INSTALL = YES;
425 | SUPPORTED_PLATFORMS = "macosx iphoneos iphonesimulator";
426 | VALID_ARCHS = "i386 x86_64 arm64 armv7 armv7s";
427 | WRAPPER_EXTENSION = bundle;
428 | };
429 | name = Release;
430 | };
431 | /* End XCBuildConfiguration section */
432 |
433 | /* Begin XCConfigurationList section */
434 | 341784B3247FD24800843085 /* Build configuration list for PBXProject "javascript" */ = {
435 | isa = XCConfigurationList;
436 | buildConfigurations = (
437 | 341784BC247FD24800843085 /* Debug */,
438 | 341784BD247FD24800843085 /* Release */,
439 | );
440 | defaultConfigurationIsVisible = 0;
441 | defaultConfigurationName = Release;
442 | };
443 | 341784BE247FD24800843085 /* Build configuration list for PBXNativeTarget "javascript" */ = {
444 | isa = XCConfigurationList;
445 | buildConfigurations = (
446 | 341784BF247FD24800843085 /* Debug */,
447 | 341784C0247FD24800843085 /* Release */,
448 | );
449 | defaultConfigurationIsVisible = 0;
450 | defaultConfigurationName = Release;
451 | };
452 | /* End XCConfigurationList section */
453 | };
454 | rootObject = 341784B0247FD24800843085 /* Project object */;
455 | }
456 |
--------------------------------------------------------------------------------
/languages/java/java.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 50;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 343E141B2487AA070067F56C /* parser.h in Headers */ = {isa = PBXBuildFile; fileRef = 343E13F52487AA070067F56C /* parser.h */; };
11 | 343E141D2487AA070067F56C /* parser.c in Sources */ = {isa = PBXBuildFile; fileRef = 343E13F72487AA070067F56C /* parser.c */; };
12 | 343E141F2487AA280067F56C /* queries in Resources */ = {isa = PBXBuildFile; fileRef = 343E141E2487AA280067F56C /* queries */; };
13 | /* End PBXBuildFile section */
14 |
15 | /* Begin PBXFileReference section */
16 | 341784F0248000AF00843085 /* java.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = java.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
17 | 341784FB248000E600843085 /* info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = info.plist; sourceTree = ""; };
18 | 343E13BD2487AA070067F56C /* .npmignore */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = .npmignore; sourceTree = ""; };
19 | 343E13BE2487AA070067F56C /* grammar.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = grammar.js; sourceTree = ""; };
20 | 343E13BF2487AA070067F56C /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = ""; };
21 | 343E13C22487AA070067F56C /* types.java */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.java; path = types.java; sourceTree = ""; };
22 | 343E13C42487AA070067F56C /* comments.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = comments.txt; sourceTree = ""; };
23 | 343E13C52487AA070067F56C /* literals.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = literals.txt; sourceTree = ""; };
24 | 343E13C62487AA070067F56C /* declarations.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = declarations.txt; sourceTree = ""; };
25 | 343E13C72487AA070067F56C /* types.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = types.txt; sourceTree = ""; };
26 | 343E13C82487AA070067F56C /* expressions.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = expressions.txt; sourceTree = ""; };
27 | 343E13C92487AA070067F56C /* binding.gyp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = binding.gyp; sourceTree = ""; };
28 | 343E13CB2487AA070067F56C /* tags.scm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = tags.scm; sourceTree = ""; };
29 | 343E13CC2487AA070067F56C /* highlights.scm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = highlights.scm; sourceTree = ""; };
30 | 343E13CD2487AA070067F56C /* index.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = index.js; sourceTree = ""; };
31 | 343E13CF2487AA070067F56C /* known-failures.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "known-failures.txt"; sourceTree = ""; };
32 | 343E13D12487AA070067F56C /* bootstrap */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = bootstrap; sourceTree = ""; };
33 | 343E13D42487AA070067F56C /* RunJavaParser.class */ = {isa = PBXFileReference; lastKnownFileType = compiled.javaclass; path = RunJavaParser.class; sourceTree = ""; };
34 | 343E13D92487AA070067F56C /* inputFiles.lst */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = inputFiles.lst; sourceTree = ""; };
35 | 343E13DA2487AA070067F56C /* createdFiles.lst */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = createdFiles.lst; sourceTree = ""; };
36 | 343E13DC2487AA070067F56C /* pom.properties */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = pom.properties; sourceTree = ""; };
37 | 343E13DD2487AA070067F56C /* run-javaparser-1.0-SNAPSHOT.jar */ = {isa = PBXFileReference; lastKnownFileType = archive.jar; path = "run-javaparser-1.0-SNAPSHOT.jar"; sourceTree = ""; };
38 | 343E13DE2487AA070067F56C /* pom.xml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = pom.xml; sourceTree = ""; };
39 | 343E13DF2487AA070067F56C /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; };
40 | 343E13E02487AA070067F56C /* run */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = run; sourceTree = ""; };
41 | 343E13E72487AA070067F56C /* RunJavaParser.java */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.java; path = RunJavaParser.java; sourceTree = ""; };
42 | 343E13E82487AA070067F56C /* parse-examples */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "parse-examples"; sourceTree = ""; };
43 | 343E13E92487AA070067F56C /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; };
44 | 343E13EA2487AA070067F56C /* issue_template.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = issue_template.md; sourceTree = ""; };
45 | 343E13EB2487AA070067F56C /* appveyor.yml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.yaml; path = appveyor.yml; sourceTree = ""; };
46 | 343E13EC2487AA070067F56C /* .gitignore */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = .gitignore; sourceTree = ""; };
47 | 343E13ED2487AA070067F56C /* package.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = package.json; sourceTree = ""; };
48 | 343E13EE2487AA070067F56C /* CONTRIBUTING.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = CONTRIBUTING.md; sourceTree = ""; };
49 | 343E13EF2487AA070067F56C /* .gitattributes */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = .gitattributes; sourceTree = ""; };
50 | 343E13F02487AA070067F56C /* .travis.yml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.yaml; path = .travis.yml; sourceTree = ""; };
51 | 343E13F22487AA070067F56C /* binding.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = binding.cc; sourceTree = ""; };
52 | 343E13F32487AA070067F56C /* node-types.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "node-types.json"; sourceTree = ""; };
53 | 343E13F52487AA070067F56C /* parser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = parser.h; sourceTree = "