This is an automated email from the ASF dual-hosted git repository. joshtynjala pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/royale-compiler.git
commit 11eb8bb818190dc3ea04077b4863f3254fa16f72 Author: Josh Tynjala <[email protected]> AuthorDate: Wed Apr 24 14:15:52 2024 -0700 CSS.g: matrix() and matrix3d() functions strictly require commas --- .../org/apache/royale/compiler/internal/css/CSS.g | 38 ++++++++++++++++++++-- .../apache/royale/compiler/internal/css/CSSTree.g | 4 +++ 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/compiler/src/main/antlr3/org/apache/royale/compiler/internal/css/CSS.g b/compiler/src/main/antlr3/org/apache/royale/compiler/internal/css/CSS.g index 2306e6732..4e872d06d 100644 --- a/compiler/src/main/antlr3/org/apache/royale/compiler/internal/css/CSS.g +++ b/compiler/src/main/antlr3/org/apache/royale/compiler/internal/css/CSS.g @@ -503,6 +503,8 @@ singleValue | RECT_VALUE | ROTATE_VALUE | TRANSLATE3D_VALUE + | MATRIX_VALUE + | MATRIX3D_VALUE | RGB | RGBA | STRING @@ -592,8 +594,6 @@ FUNCTIONS : '-moz-linear-gradient' | 'skewY' | 'skew' | 'perspective' - | 'matrix' - | 'matrix3d' | 'blur' | 'brightness' | 'contrast' @@ -638,6 +638,40 @@ TRANSLATE3D_VALUE : 'translate3d(' ( options {greedy=false;}: . )* ')' ; */ RECT_VALUE : 'rect(' ( options {greedy=false;}: . )* ')' ; +/** + * Matches a matrix value - matrix(0, 1, 1, 0, 0, 0); + */ +MATRIX_VALUE : 'matrix(' ( WS* NUMBER WS* ) ',' + ( WS* NUMBER WS* ) ',' + ( WS* NUMBER WS* ) ',' + ( WS* NUMBER WS* ) ',' + ( WS* NUMBER WS* ) ',' + ( WS* NUMBER WS* ) + ')' + ; + +/** + * Matches a matrix3d value - matrix3d(-0.6,1.3,0,0,-2.3,-0.6,0,0,0,0,1,0,0,0,10,1); + */ +MATRIX3D_VALUE : 'matrix3d(' ( WS* NUMBER WS* ) ',' + ( WS* NUMBER WS* ) ',' + ( WS* NUMBER WS* ) ',' + ( WS* NUMBER WS* ) ',' + ( WS* NUMBER WS* ) ',' + ( WS* NUMBER WS* ) ',' + ( WS* NUMBER WS* ) ',' + ( WS* NUMBER WS* ) ',' + ( WS* NUMBER WS* ) ',' + ( WS* NUMBER WS* ) ',' + ( WS* NUMBER WS* ) ',' + ( WS* NUMBER WS* ) ',' + ( WS* NUMBER WS* ) ',' + ( WS* NUMBER WS* ) ',' + ( WS* NUMBER WS* ) ',' + ( WS* NUMBER WS* ) + ')' + ; + /** * Matches an rgba definition - rgba(100%,100%,100%,100%) */ diff --git a/compiler/src/main/antlr3/org/apache/royale/compiler/internal/css/CSSTree.g b/compiler/src/main/antlr3/org/apache/royale/compiler/internal/css/CSSTree.g index a7cf91245..cd79ce6f5 100644 --- a/compiler/src/main/antlr3/org/apache/royale/compiler/internal/css/CSSTree.g +++ b/compiler/src/main/antlr3/org/apache/royale/compiler/internal/css/CSSTree.g @@ -418,6 +418,10 @@ singleValue returns [CSSPropertyValue propertyValue] { $propertyValue = CSSKeywordPropertyValue.create($start, tokenStream); } | TRANSLATE3D_VALUE { $propertyValue = CSSKeywordPropertyValue.create($start, tokenStream); } + | MATRIX_VALUE + { $propertyValue = CSSKeywordPropertyValue.create($start, tokenStream); } + | MATRIX3D_VALUE + { $propertyValue = CSSKeywordPropertyValue.create($start, tokenStream); } | RGB { $propertyValue = new CSSRgbColorPropertyValue($RGB.text, $start, tokenStream); } | RGBA
