### Is there an existing issue for this?

- [X] I have searched the existing issues

### Current Behavior

I'm trying to create a state machine using the following definition that I validated on AWS:

```json
{
  "StartAt": "GetSuffix",
  "States": {
    "GetSuffix": {
      "Type": "Pass",
      "Parameters": {
        "suffix.$": "States.ArrayGetItem(States.StringSplit($$.StateMachine.Name, '-'), States.MathAdd(States.ArrayLength(States.StringSplit($$.StateMachine.Name, '-')), -1))"
      },
      "End": true
    }
  }
}
```

It fails with the following error:
```
│ Error: updating Step Functions State Machine (arn:aws:states:eu-west-3:000000000000:stateMachine:my-state-machine): InvalidDefinition: Error=ValueError Args=["Expected 2 arguments for function type '<class 'localstack.services.stepfunctions.asl.component.intrinsic.function.statesfunction.string_operations.string_split.StringSplit'>', but got: '(FunctionArgumentList| {'arg_list': [], 'size': 0}'."] in definition '{
│   "StartAt": "GetSuffix",
│   "States": {
│     "GetSuffix": {
│       "Type": "Pass",
│       "Parameters": {
│         "suffix.$": "States.ArrayGetItem(States.StringSplit($$.StateMachine.Name, '-'), States.MathAdd(States.ArrayLength(States.StringSplit($$.StateMachine.Name, '-')), -1))"
│       },
│       "End": true
│     }
│   }
│ }
│ '.
│ 
│   with aws_sfn_state_machine.main,
│   on stepFunction.tf line 1, in resource "aws_sfn_state_machine" "main":
│    1: resource "aws_sfn_state_machine" "main" {
```

Based on my tests there seems to be 2 issues:
- Using a variable starting with `$$` as a function argument is not supported.
- Passing the result of a function directly as another function argument is not supported.

### Expected Behavior

The definition should be considered valid and the state machine should be created.

### How are you starting LocalStack?

With the `localstack` script

### Steps To Reproduce

Create a state machine using the provided definition.

### Environment

```markdown
- LocalStack: 2.3.0
- PROVIDER_OVERRIDE_STEPFUNCTIONS=v2
- Terraform v1.6.2
```


### Anything else?

_No response_
self, create_iam_role_for_sfn, create_state_machine, sfn_snapshot, aws_client
    ):
        values = [
            "",
            " ",
            "HelloWorld",
            None,
            1,
            1.1,
            '{"Arg1": 1, "Arg2": []}',
            json.loads('{"Arg1": 1, "Arg2": []}'),
        ]
        input_values = list()
        for value in values:
            input_values.append({"fst": value, "snd": value})
        create_and_test_on_inputs(
            aws_client.stepfunctions,
            create_iam_role_for_sfn,
            create_state_machine,
            sfn_snapshot,
            IFT.FORMAT_2,
            input_values,
        )
    @markers.aws.validated
    def test_context_json_path(