Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

defined-or "//" over multiple lines

Tags:

raku

Why are version 1,2 and 3 working, but version 4 fails with: Null regex not allowed when using // over multiple lines?

#1
say Nil         //
    try {'a'++} //
    1;

#2
say    Nil
    // try {'a'++} //
       2;

#3
say   Nil
   // 3;

#Fails with: Null regex not allowed
say        Nil
        // try {'a'++}
        // 4;
like image 548
LuVa Avatar asked Apr 09 '19 17:04

LuVa


People also ask

What do you mean by multiline?

a : consisting of multiple lines of text a multiline headline : capable of showing, containing, or processing multiple lines of text a multiline display/field New multiline optical character readers are already being put in place; they can read an entire address and spray forth a bar code that stands for a nine-digit ...

Is multiline a word?

Definition of 'multiline' 1. 2. Imagine the Oval Office, a room full of polished wood and mementos, multiline telephones and important papers.

How is multiline macro defined?

We can write multiline macros like functions, but for macros, each line must be terminated with backslash '\' character. If we use curly braces '{}' and the macros is ended with '}', then it may generate some error. So we can enclose the entire thing into parenthesis.

What is multiline text?

A multline text input field stores a string as its value and a string as its text. Its value is always a valid string, while its text could be any string entered into its editor. Unlike a text input field, this field also supports newline characters entered in the editor.


1 Answers

There is try block at the end of a line. It is same as

say        Nil
    // try {'a'++};
    // 4;

See documentation: It is OK to skip the semicolon between the last statement in a block and the closing }.

You can try

say        Nil
    // try {'a'++}\
    // 4;

or

say        Nil
    // (try {'a'++})
    // 4;
like image 127
wamba Avatar answered Oct 05 '22 13:10

wamba