WSL should support for loops
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Sep 2017 17:47:44 +0000 (17:47 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Sep 2017 17:47:44 +0000 (17:47 +0000)
commitb3c2df3edf4432b2b9a0fadfb25dc394ff652bde
tree023eca198245b407b3fdd13553e2f25d429add4e
parent305e91fe3ef980c0fb48935cbc64bdb378b0070c
WSL should support for loops
https://bugs.webkit.org/show_bug.cgi?id=176682

Reviewed by Filip Pizlo.

Follows the pattern of the existing infrastructure of while loops.

* WebGPUShadingLanguageRI/All.js:
* WebGPUShadingLanguageRI/Checker.js:
* WebGPUShadingLanguageRI/Evaluator.js:
(Evaluator.prototype.visitForLoop):
* WebGPUShadingLanguageRI/ForLoop.js: Copied from Tools/WebGPUShadingLanguageRI/LoopChecker.js.
(ForLoop):
(ForLoop.prototype.get origin):
(ForLoop.prototype.get initialization):
(ForLoop.prototype.get condition):
(ForLoop.prototype.get increment):
(ForLoop.prototype.get body):
(ForLoop.prototype.toString):
* WebGPUShadingLanguageRI/LoopChecker.js:
(LoopChecker.prototype.visitForLoop):
* WebGPUShadingLanguageRI/NameResolver.js:
(NameResolver.prototype.visitForLoop):
* WebGPUShadingLanguageRI/Parse.js:
(parseFor):
* WebGPUShadingLanguageRI/ReturnChecker.js:
(ReturnChecker.prototype._isBoolCastFromLiteralTrue):
(ReturnChecker.prototype.visitWhileLoop):
(ReturnChecker.prototype.visitDoWhileLoop):
(ReturnChecker.prototype.visitForLoop):
* WebGPUShadingLanguageRI/Rewriter.js:
(Rewriter.prototype.visitForLoop):
(Rewriter):
* WebGPUShadingLanguageRI/Test.html:
* WebGPUShadingLanguageRI/Test.js:
(TEST_forLoop):
* WebGPUShadingLanguageRI/Visitor.js:
(Visitor.prototype.visitForLoop):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@221865 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
Tools/ChangeLog
Tools/WebGPUShadingLanguageRI/All.js
Tools/WebGPUShadingLanguageRI/Checker.js
Tools/WebGPUShadingLanguageRI/Evaluator.js
Tools/WebGPUShadingLanguageRI/ForLoop.js [new file with mode: 0644]
Tools/WebGPUShadingLanguageRI/LoopChecker.js
Tools/WebGPUShadingLanguageRI/NameResolver.js
Tools/WebGPUShadingLanguageRI/Parse.js
Tools/WebGPUShadingLanguageRI/ReturnChecker.js
Tools/WebGPUShadingLanguageRI/Rewriter.js
Tools/WebGPUShadingLanguageRI/Test.html
Tools/WebGPUShadingLanguageRI/Test.js
Tools/WebGPUShadingLanguageRI/Visitor.js