r27554 - revert untested breaking parser change by @Veracity0

Crowther

Active member
Interestingly all my code for the day run just fine, except this line:

matcher m = create_matcher("Clan: <b><a class=nounder href=\"showclan.php\\?whichclan=([0-9]+)\">(.+?)<", page);

The parser was expecting a '{' instead of the final ')'.
 

Veracity

Developer
Staff member
Yeah, I really don’t understand what was wrong with that little change - accept any Composite literal rather than just an Aggregate literal. Perhaps its an issue in RecordLiteral?

But I need to debug it before trying again.
 

Veracity

Developer
Staff member
I now understand that section of code.

We have ArrayLiterals and MapLiterals which need to know what kind of aggregate they are constructing. In almost all contexts, you know that type - assignments, function returns, record fields, whatever. The one exception is function parameters. When you write a function call, we parse all the parameters and then go looking for the most appropriate function with the specified name that will accept all those args.

If we don't know what type the array or map you want, you can't parse a literal into an object of the correct sort, which can be matched to function parameter types.

Code:
int x = my_function(10, "abc", int[] {1, 2, 3});

will look for "my_function" which will accept three args: an int, a string, and an array of ints.

We presumably need the same thing if you have a function which takes a record and you want to use a record literal.

I'm running across this with my current function object work because an arrow function is essentially a function literal.
 
Top