File tree Expand file tree Collapse file tree 3 files changed +40
-18
lines changed Expand file tree Collapse file tree 3 files changed +40
-18
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,11 @@ def → = ???
58
58
59
59
val test = id.##
60
60
61
+ val x = y
62
+ /////////
63
+ // avoid matching slashes as operator
64
+ /////////
65
+
61
66
---
62
67
63
68
(compilation_unit
@@ -66,21 +71,13 @@ val test = id.##
66
71
(type_parameters
67
72
(covariant_type_parameter
68
73
(identifier)))
69
- (infix_type
70
- (stable_type_identifier
71
- (stable_identifier
72
- (identifier)
73
- (identifier))
74
+ (generic_type
75
+ (stable_type_identifier (stable_identifier (stable_identifier (identifier) (identifier)) (identifier))
74
76
(type_identifier))
75
- (operator_identifier)
76
- (generic_type
77
- (type_identifier
78
- (MISSING _alpha_identifier))
79
- (type_arguments
80
- (type_identifier)))))
77
+ (type_arguments (type_identifier))))
81
78
(val_definition
82
79
(operator_identifier)
83
- (postfix_expression
80
+ (field_expression
84
81
(field_expression
85
82
(field_expression
86
83
(identifier)
@@ -89,24 +86,28 @@ val test = id.##
89
86
(operator_identifier)))
90
87
(val_definition
91
88
(operator_identifier)
92
- (postfix_expression
89
+ (field_expression
93
90
(field_expression
94
91
(identifier)
95
92
(identifier))
96
93
(operator_identifier)))
97
94
(val_definition
98
95
(operator_identifier)
99
- (postfix_expression
96
+ (field_expression
100
97
(field_expression
101
98
(identifier)
102
99
(identifier))
103
100
(operator_identifier)))
104
101
(function_definition (operator_identifier) (operator_identifier))
105
102
(val_definition
106
103
(identifier)
107
- (postfix_expression
104
+ (field_expression
108
105
(identifier)
109
- (operator_identifier))))
106
+ (operator_identifier)))
107
+ (val_definition (identifier) (identifier))
108
+ (comment)
109
+ (comment)
110
+ (comment))
110
111
111
112
================================
112
113
Package
Original file line number Diff line number Diff line change @@ -1165,7 +1165,28 @@ module.exports = grammar({
1165
1165
1166
1166
wildcard : $ => '_' ,
1167
1167
1168
- operator_identifier : $ => / [ ! # % & * + -\/ : < = > ? @ ' ^ \| ‘ ~ \p{ Sm} \p{ So} ] + / ,
1168
+ /**
1169
+ * Regex patterns created to avoid matching // comments.
1170
+ * This could technically match illeagal tokens such as val ?// = 1
1171
+ */
1172
+ operator_identifier : $ => token ( choice (
1173
+ // single opchar
1174
+ / [ \- ! # % & * + \/ \\ : < = > ? @ \u005e \u007c ~ \p{ Sm} \p{ So} ] / ,
1175
+ seq (
1176
+ // opchar minus slash
1177
+ / [ \- ! # % & * + \\ : < = > ? @ \u005e \u007c ~ \p{ Sm} \p{ So} ] / ,
1178
+ // opchar*
1179
+ repeat1 ( / [ \- ! # % & * + \/ \\ : < = > ? @ \u005e \u007c ~ \p{ Sm} \p{ So} ] / ) ,
1180
+ ) ,
1181
+ seq (
1182
+ // opchar
1183
+ / [ \- ! # % & * + \/ \\ : < = > ? @ \u005e \u007c ~ \p{ Sm} \p{ So} ] / ,
1184
+ // opchar minus slash
1185
+ / [ \- ! # % & * + \\ : < = > ? @ \u005e \u007c ~ \p{ Sm} \p{ So} ] / ,
1186
+ // opchar*
1187
+ repeat ( / [ \- ! # % & * + \/ \\ : < = > ? @ \u005e \u007c ~ \p{ Sm} \p{ So} ] / ) ,
1188
+ ) ,
1189
+ ) ) ,
1169
1190
1170
1191
_non_null_literal : $ =>
1171
1192
choice (
Original file line number Diff line number Diff line change 4
4
5
5
SCALA_SCALA_LIBRARY_EXPECTED=100
6
6
SCALA_SCALA_COMPILER_EXPECTED=66
7
- DOTTY_COMPILER_EXPECTED=74
7
+ DOTTY_COMPILER_EXPECTED=66
8
8
9
9
if [ ! -d " $SCALA_SCALA_DIR " ]; then
10
10
echo " \$ SCALA_SCALA_DIR must be set"
You can’t perform that action at this time.
0 commit comments