Skip to content

Commit 749a13a

Browse files
committed
[libSyntax] Remove the C++ SyntaxClassifier
The recommended way forward is to use the SyntaxClassifier on the Swift side. By removing the C++ SyntaxClassifier, we can also eliminate the -force-libsyntax-based-processing option that was used to bootstrap incremental parsing and would generate the syntax map from a syntax tree.
1 parent bae0481 commit 749a13a

38 files changed

+206
-1650
lines changed

include/swift/Syntax/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ set(generated_include_sources
88
SyntaxKind.h.gyb
99
SyntaxNodes.h.gyb
1010
SyntaxBuilders.h.gyb
11-
SyntaxClassifier.h.gyb
1211
SyntaxFactory.h.gyb
1312
SyntaxVisitor.h.gyb
1413
Trivia.h.gyb)

include/swift/Syntax/SyntaxClassifier.h.gyb

Lines changed: 0 additions & 118 deletions
This file was deleted.

lib/Syntax/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,5 @@ add_swift_library(swiftSyntax STATIC
1414
RawSyntax.cpp
1515
Syntax.cpp
1616
SyntaxArena.cpp
17-
SyntaxClassifier.cpp.gyb
1817
SyntaxData.cpp
1918
UnknownSyntax.cpp)

lib/Syntax/SyntaxClassifier.cpp.gyb

Lines changed: 0 additions & 160 deletions
This file was deleted.

test/IDE/coloring.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// RUN: %target-swift-ide-test -syntax-coloring -source-filename %s | %FileCheck %s
2-
// RUN: %target-swift-ide-test -syntax-coloring -typecheck -source-filename %s | %FileCheck %s -check-prefix CHECK -check-prefix CHECK-OLD
3-
// RUN: %target-swift-ide-test -syntax-coloring -force-libsyntax-based-processing -source-filename %s | %FileCheck %s --check-prefix CHECK -check-prefix CHECK-NEW
2+
// RUN: %target-swift-ide-test -syntax-coloring -typecheck -source-filename %s | %FileCheck %s -check-prefixes CHECK,CHECK-OLD
43
// XFAIL: broken_std_regex
54

65
#line 17 "abc.swift"

test/IDE/coloring_configs.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// RUN: %target-swift-ide-test -syntax-coloring -source-filename %s -D CONF | %FileCheck %s
2-
// RUN: %target-swift-ide-test -syntax-coloring -force-libsyntax-based-processing -source-filename %s -D CONF | %FileCheck %s
32

43
// CHECK: <kw>var</kw> f : <type>Int</type>
54
var f : Int

test/IDE/coloring_keywords.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// RUN: %target-swift-ide-test -syntax-coloring -source-filename %s | %FileCheck %s
2-
// RUN: %target-swift-ide-test -syntax-coloring -force-libsyntax-based-processing -source-filename %s | %FileCheck %s
32
// RUN: %target-swift-ide-test -syntax-coloring -typecheck -source-filename %s | %FileCheck %s
43

54
// CHECK: <kw>return</kw> c.return

test/IDE/coloring_unclosed_hash_if.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// RUN: %target-swift-ide-test -syntax-coloring -source-filename %s | %FileCheck %s
2-
// RUN: %target-swift-ide-test -syntax-coloring -force-libsyntax-based-processing -source-filename %s | %FileCheck %s
32
// RUN: %target-swift-ide-test -syntax-coloring -typecheck -source-filename %s | %FileCheck %s
43

54
// CHECK: <#kw>#if</#kw> <#id>d</#id>

test/SourceKit/SyntaxMapData/syntaxmap-edit-block-comment.swift

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// RUN: %sourcekitd-test -req=open -print-raw-response %S/Inputs/syntaxmap-edit-block-comment.swift == -req=edit -print-raw-response %S/Inputs/syntaxmap-edit-block-comment.swift -pos=4:2 -replace=" " -length=1 == -req=edit -print-raw-response %S/Inputs/syntaxmap-edit-block-comment.swift -pos=4:2 -replace="/" -length=1 == -req=edit -print-raw-response %S/Inputs/syntaxmap-edit-block-comment.swift -pos=1:1 -replace="//" -length=2 | %sed_clean > %t.response
2-
// RUN: %FileCheck -input-file=%t.response %s --check-prefixes CHECK,CHECK-OLD
3-
// RUN: %sourcekitd-test -req=open -print-raw-response %S/Inputs/syntaxmap-edit-block-comment.swift -force-libsyntax-based-processing == -req=edit -print-raw-response %S/Inputs/syntaxmap-edit-block-comment.swift -pos=4:2 -replace=" " -length=1 -force-libsyntax-based-processing == -req=edit -print-raw-response %S/Inputs/syntaxmap-edit-block-comment.swift -pos=4:2 -replace="/" -length=1 -force-libsyntax-based-processing == -req=edit -print-raw-response %S/Inputs/syntaxmap-edit-block-comment.swift -pos=1:1 -replace="//" -length=2 -force-libsyntax-based-processing | %sed_clean > %t.libSyntax.response
4-
// RUN: %FileCheck -input-file=%t.libSyntax.response %s --check-prefixes CHECK,CHECK-NEW
2+
// RUN: %FileCheck -input-file=%t.response %s
53

64
// Initial state
75

@@ -89,14 +87,12 @@
8987

9088
// CHECK: {{^}}{
9189
// CHECK-NEXT: key.offset: 0,
92-
// CHECK-OLD-NEXT: key.length: 3,
93-
// CHECK-NEW-NEXT: key.length: 2,
90+
// CHECK-NEXT: key.length: 3,
9491
// CHECK-NEXT: key.diagnostic_stage: source.diagnostic.stage.swift.parse,
9592
// CHECK-NEXT: key.syntaxmap: [
9693
// CHECK-NEXT: {
9794
// CHECK-NEXT: key.kind: source.lang.swift.syntaxtype.comment,
9895
// CHECK-NEXT: key.offset: 0,
99-
// CHECK-OLD-NEXT: key.length: 3
100-
// CHECK-NEW-NEXT: key.length: 2
96+
// CHECK-NEXT: key.length: 3
10197
// CHECK-NEXT: }
10298
// CHECK-NEXT: ],

test/SourceKit/SyntaxMapData/syntaxmap-edit-chained-comment.swift

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// RUN: %sourcekitd-test -req=open -print-raw-response %S/Inputs/syntaxmap-edit-chained-comment.swift == -req=edit -print-raw-response %S/Inputs/syntaxmap-edit-chained-comment.swift -pos=1:9 -replace=" " -length=1 == -req=edit -print-raw-response %S/Inputs/syntaxmap-edit-chained-comment.swift -pos=1:9 -replace="/" -length=1 | %sed_clean > %t.response
2-
// RUN: %FileCheck -input-file=%t.response %s --check-prefixes CHECK,CHECK-OLD
3-
// RUN: %sourcekitd-test -req=open -print-raw-response %S/Inputs/syntaxmap-edit-chained-comment.swift -force-libsyntax-based-processing == -req=edit -print-raw-response %S/Inputs/syntaxmap-edit-chained-comment.swift -pos=1:9 -replace=" " -length=1 -force-libsyntax-based-processing == -req=edit -print-raw-response %S/Inputs/syntaxmap-edit-chained-comment.swift -pos=1:9 -replace="/" -length=1 -force-libsyntax-based-processing | %sed_clean > %t.libsyntax.response
4-
// RUN: %FileCheck -input-file=%t.libsyntax.response %s --check-prefixes CHECK,CHECK-NEW
2+
// RUN: %FileCheck -input-file=%t.response %s
53

64
// Initial state
75

@@ -48,8 +46,7 @@
4846
// CHECK-NEXT: {
4947
// CHECK-NEXT: key.kind: source.lang.swift.syntaxtype.comment,
5048
// CHECK-NEXT: key.offset: 13,
51-
// CHECK-OLD-NEXT: key.length: 6
52-
// CHECK-NEW-NEXT: key.length: 5
49+
// CHECK-NEXT: key.length: 6
5350
// CHECK-NEXT: }
5451
// CHECK-NEXT: ],
5552

test/SourceKit/SyntaxMapData/syntaxmap-edit-del.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,3 @@
22
// RUN: diff -u %s.response %t.response
33
// RUN: %sourcekitd-test -req=syntax-map -pos=4:1 -length=2 -replace="" %S/Inputs/syntaxmap-edit-del.swift | %sed_clean > %t.response2
44
// RUN: diff -u %s.response2 %t.response2
5-
6-
// RUN: %sourcekitd-test -req=syntax-map -pos=2:1 -length=2 -replace=" " %S/Inputs/syntaxmap-edit-del.swift -force-libsyntax-based-processing | %sed_clean > %t.libsyntax.response
7-
// RUN: diff -u %s.response %t.libsyntax.response
8-
// RUN: %sourcekitd-test -req=syntax-map -pos=4:1 -length=2 -replace="" %S/Inputs/syntaxmap-edit-del.swift -force-libsyntax-based-processing | %sed_clean > %t.libsyntax.response2
9-
// RUN: diff -u %s.response2 %t.libsyntax.response2

test/SourceKit/SyntaxMapData/syntaxmap-edit-disjoint-effect.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// RUN: %sourcekitd-test -req=open -print-raw-response %S/Inputs/syntaxmap-edit-disjoint-effect.swift == -req=edit -print-raw-response %S/Inputs/syntaxmap-edit-disjoint-effect.swift -pos=1:11 -replace='(' -length=1 | %sed_clean > %t.response
22
// RUN: %FileCheck -input-file=%t.response %s
3-
// RUN: %sourcekitd-test -req=open -print-raw-response %S/Inputs/syntaxmap-edit-disjoint-effect.swift -force-libsyntax-based-processing == -req=edit -print-raw-response %S/Inputs/syntaxmap-edit-disjoint-effect.swift -pos=1:11 -replace='(' -length=1 -force-libsyntax-based-processing | %sed_clean > %t.libsyntax.response
4-
// RUN: %FileCheck -input-file=%t.libsyntax.response %s
53

64
// Original contents
75

0 commit comments

Comments
 (0)