OpenKore / OpenKore/openkore

Whitespace sensitivity for EventMacro

Open
#3,759 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Perl
Stars
1.5k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

  • Openkore version git: Latest
  • Server: Private server
  • Bug Report / Feature Request: Whitespace sensitivity for EventMacro
  • Summary: Just wondering if the Flow control statements are intended to be whitespace sensitive? the macro 1,2 and 3 below would behave differently after all. if its intended then neverminded me, if its not I can take a look at it further, might be a problem with the regex?
macro 1{
	$i = 0
	while($i < 10) {
	log \$i = $i
	$i++
        )
}

macro 1 would do the first iteration and print out a $i = 0, then would proceed to break out of the while loop, when i turn on the debug messages i would get these at the end
[eventMacro] Script '}'.
[eventMacro] Script is the end of a not important block (if or switch).

macro 2{
	$i = 0
	while ($i < 10) {
	log \$i = $i
	$i++
        }
}

macro 2 would work as intended, logging 1 to 10.

macro 3{
	$i = 0
	while ($i < 10){
	log \$i = $i
	$i++
        }
}

And macro 3 would outright crash the openkore and would output a message of
"The error message is:
Modification of non-creatable array value attempted, subscript -1 at plugins/eventMacro/eventMacro/Runner.pm line 1421."

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the three EventMacro examples and compare their behavior with the reported debug output and crash. Start at plugins/eventMacro/eventMacro/Runner.pm line 1421, then trace the flow-control handling reached by the while statements. Done means whitespace variations are handled consistently according to the intended syntax and the crash no longer occurs.

Written by the indexing model from the issue text.

Assessment

Tech stack
perl
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.