@@ -188,6 +188,8 @@ func parse() {
188
188
switch {
189
189
case char == ' ' || char == '\t' || char == '\n' :
190
190
advance ()
191
+ case isChar ('/' ):
192
+ collectComment ()
191
193
case tokenAhead (Question ):
192
194
collectQuestion ()
193
195
case tokenAhead (Definition ):
@@ -199,8 +201,6 @@ func parse() {
199
201
case tokenAhead (Constant ):
200
202
advance ()
201
203
collectVariable (true )
202
- case isChar ('/' ):
203
- collectComment ()
204
204
case tokenAhead (Repeat ):
205
205
collectRepeat ()
206
206
case tokenAhead (RepeatWithEach ):
@@ -293,18 +293,21 @@ func lookAheadUntil(until rune) string {
293
293
294
294
func collectVariableValue (constant bool , valueType * tokenType , value * any ) {
295
295
collectValue (valueType , value , '\n' )
296
-
297
- var aheadOfValue = lookAheadUntil ('\n' )
298
- if containsExpressionTokens (aheadOfValue ) {
299
- collectExpression (valueType , value )
300
- return
301
- }
302
296
if constant && (* valueType == Arr || * valueType == Variable ) {
303
297
parserError (fmt .Sprintf ("Type %v values cannot be constants." , * valueType ))
304
298
}
305
299
if * valueType == Question {
306
300
parserError (fmt .Sprintf ("Illegal reference to import question '%s'. Shortcuts does not support import questions as variable values." , * value ))
307
301
}
302
+
303
+ var aheadOfValue = lookAheadUntil ('\n' )
304
+ if strings .Contains (aheadOfValue , "//" ) || strings .Contains (aheadOfValue , "/*" ) {
305
+ return
306
+ }
307
+ if containsExpressionTokens (aheadOfValue ) {
308
+ collectExpression (valueType , value )
309
+ return
310
+ }
308
311
}
309
312
310
313
func collectExpression (valueType * tokenType , value * any ) {
0 commit comments