Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public static JavaFunction<?> registerFunction(JavaFunction<?> function) {
return function;
}

public final static String functionNamePattern = "[\\p{IsAlphabetic}][\\p{IsAlphabetic}\\p{IsDigit}_]*";
public final static String functionNamePattern = "[\\p{IsAlphabetic}_][\\p{IsAlphabetic}\\p{IsDigit}_]*";

/**
* Loads a script function from given node.
Expand Down
4 changes: 4 additions & 0 deletions src/test/skript/tests/syntaxes/structures/StructFunction.sk
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ local function local() :: number:
local function bar() :: boolean:
return true

local function _blob() :: string:
return "blub"

test "functions":
assert foo() is true with "function return type failed"
assert local() is not 1 with "global function parsed before local function"
assert bar() is true with "local function didn't execute correctly"
assert _blob() is "blub" with "function that starts with underscore didn't execute correctly"