Skip to content

Recursion#121

Merged
Zeex merged 2 commits intopawn-lang:masterfrom
ziggi:recursion
Nov 13, 2016
Merged

Recursion#121
Zeex merged 2 commits intopawn-lang:masterfrom
ziggi:recursion

Conversation

@ziggi
Copy link
Contributor

@ziggi ziggi commented Nov 11, 2016

I have found nice feature in your recursion branch. This is it but with adding -R parameter for enabling or disabling this feature.

Example:

f1() {
	f2();
}

f2() {
	f3();
}

f3() {
	f4();
}

f4() {
	f1();
}

will output:

recursion detected: function f1 indirectly calls itself:
f1 <- f4 <- f3 <- f2 <- f1
recursion detected: function f2 indirectly calls itself:
f2 <- f1 <- f4 <- f3 <- f2
recursion detected: function f3 indirectly calls itself:
f3 <- f2 <- f1 <- f4 <- f3
recursion detected: function f4 indirectly calls itself:
f4 <- f3 <- f2 <- f1 <- f4

ziggi added 2 commits October 25, 2016 06:32
Applied path from https://github.com/Zeex/pawn/tree/recursion branch.

Example:

f1() {
	f2();
}

f2() {
	f3();
}

f3() {
	f4();
}

f4() {
	f1();
}

will output:

recursion detected: function f1 indirectly calls itself:
f1 <- f4 <- f3 <- f2 <- f1
recursion detected: function f2 indirectly calls itself:
f2 <- f1 <- f4 <- f3 <- f2
recursion detected: function f3 indirectly calls itself:
f3 <- f2 <- f1 <- f4 <- f3
recursion detected: function f4 indirectly calls itself:
f4 <- f3 <- f2 <- f1 <- f4
@Zeex Zeex merged commit 1697d6f into pawn-lang:master Nov 13, 2016
@Zeex
Copy link
Contributor

Zeex commented Nov 13, 2016

Thanks! Didn't realize this would be of any use to anybody, glad that it is 😄

@ziggi
Copy link
Contributor Author

ziggi commented Nov 13, 2016

Sometimes it's really useful feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants