[WSL] Ternary expressions appear to be unimplemented
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Aug 2018 21:43:03 +0000 (21:43 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Aug 2018 21:43:03 +0000 (21:43 +0000)
commit961e2a2ceb8260411609de0e3d660c2f6aab4ca4
treeb9a1ba8e9d0047dc9756ef878d808cc00c37e8de
parent58042fa68d328c050f7c4bc3faf739b2ce3fc1dd
[WSL] Ternary expressions appear to be unimplemented
https://bugs.webkit.org/show_bug.cgi?id=178981

Reviewed by Saam Barati.

Implement ternary statements. These can be both lvalues and rvalues. (a ? b : c ? d : e)
is parsed as (a ? b : (c ? d : e)).

* WebGPUShadingLanguageRI/All.js:
* WebGPUShadingLanguageRI/Checker.js:
(Checker.prototype.visitTernaryExpression):
* WebGPUShadingLanguageRI/Evaluator.js:
(Evaluator.prototype.visitTernaryExpression):
* WebGPUShadingLanguageRI/NormalUsePropertyResolver.js:
(NormalUsePropertyResolver.prototype.visitTernaryExpression):
(NormalUsePropertyResolver):
* WebGPUShadingLanguageRI/Parse.js:
(parsePossibleTernaryConditional):
* WebGPUShadingLanguageRI/PropertyResolver.js:
(PropertyResolver.prototype._visitRValuesWithinLValue.RValueFinder.prototype.visitTernaryExpression):
(PropertyResolver.prototype._visitRValuesWithinLValue.RValueFinder):
(PropertyResolver.prototype._visitRValuesWithinLValue):
* WebGPUShadingLanguageRI/Rewriter.js:
(Rewriter.prototype.visitTernaryExpression):
* WebGPUShadingLanguageRI/SPIRV.html:
* WebGPUShadingLanguageRI/Test.html:
* WebGPUShadingLanguageRI/Test.js:
* WebGPUShadingLanguageRI/Visitor.js:
(Visitor.prototype.visitProtocolDecl):
* WebGPUShadingLanguageRI/index.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235249 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
Tools/ChangeLog
Tools/WebGPUShadingLanguageRI/All.js
Tools/WebGPUShadingLanguageRI/Checker.js
Tools/WebGPUShadingLanguageRI/Evaluator.js
Tools/WebGPUShadingLanguageRI/NormalUsePropertyResolver.js
Tools/WebGPUShadingLanguageRI/Parse.js
Tools/WebGPUShadingLanguageRI/PropertyResolver.js
Tools/WebGPUShadingLanguageRI/Rewriter.js
Tools/WebGPUShadingLanguageRI/SPIRV.html
Tools/WebGPUShadingLanguageRI/TernaryExpression.js [new file with mode: 0644]
Tools/WebGPUShadingLanguageRI/Test.html
Tools/WebGPUShadingLanguageRI/Test.js
Tools/WebGPUShadingLanguageRI/Visitor.js
Tools/WebGPUShadingLanguageRI/index.html