slate-language icon indicating copy to clipboard operation
slate-language copied to clipboard

Can't Create SocketAddress Object

Open fribeiro1 opened this issue 8 years ago • 2 comments

When creating a SocketAddress object with the code below, I am getting the following error:

load: 'src/net/sockets.slate'

[| addr |
  addr: (Net SocketAddress newOn: '127.0.0.1:61613').
] do.

The method #subexpression: was not found for the following arguments: {#(Matcher subexpressions: #(Dictionary ...). matchee: '127.0.0.1:61613'. regex: #(Expression ...). Fail: -1). 0}

Am I doing something wrong, or is there a bug there?

fribeiro1 avatar Dec 27 '15 20:12 fribeiro1

It starts here: https://github.com/briantrice/slate-language/blob/master/src/net/sockets.slate#L100C3-L100C3

But I think it's traced to @timmydo's work on the regex update, where the regex library was swapped out without updating the callers fully, here: https://github.com/briantrice/slate-language/commit/3b8a08bf0b12b6bf58c1834b14c64f96357d4249

Basically, it's calling the old library's subexpression: method, which wasn't ported to the new library per se, and it should be calling subexpressionAt: instead.

briantrice avatar Jul 05 '23 03:07 briantrice

I've created a PR I think addresses this, will have to test: https://github.com/briantrice/slate-language/pull/4

briantrice avatar Jul 05 '23 03:07 briantrice