You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by jo...@apache.org on 2025/09/08 22:50:00 UTC

(royale-compiler) branch develop updated: CSS.g: fix Decision can match input warnings for rgb() and rgba()

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


The following commit(s) were added to refs/heads/develop by this push:
     new 071c9ddf7 CSS.g: fix Decision can match input warnings for rgb() and rgba()
071c9ddf7 is described below

commit 071c9ddf7c4b6a0425e45429956b61ccab3c32ad
Author: Josh Tynjala <jo...@apache.org>
AuthorDate: Mon Sep 8 15:43:49 2025 -0700

    CSS.g: fix Decision can match input warnings for rgb() and rgba()
    
    Specifically this warning:
    
    Decision can match input such as "{'\t'..'\n', '\r', ' '}" using multiple alternatives: 1, 2
    
    It's because it was trying to match optional whitespace immediately followed by more optional whitespace in some situations.
---
 .../src/main/antlr3/org/apache/royale/compiler/internal/css/CSS.g | 8 ++++----
 1 file changed, 4 insertions(+), 4 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 6a4bec0ed..c21f282a3 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
@@ -689,8 +689,8 @@ RGBA : 	'rgba(' 	( WS* NUMBER ( PERCENT | ) WS* ) ','
 				( WS* NUMBER ( PERCENT | ) WS* ) ',' 
 				( WS* NUMBER ( PERCENT | ) WS* ) 
 		')'
-    |   'rgba(' 	( WS* NUMBER ( PERCENT | ) WS* ) 
-				( WS* NUMBER ( PERCENT | ) WS* ) 
+    |   'rgba(' 	( WS* NUMBER ( PERCENT | ) ) 
+				( WS* NUMBER ( PERCENT | ) ) 
 				( WS* NUMBER ( PERCENT | ) WS* ) '/'
 				( WS* NUMBER ( PERCENT | ) WS* ) 
 		')'
@@ -703,8 +703,8 @@ RGB : 	'rgb(' 	( WS* NUMBER ( PERCENT | ) WS* ) ','
 				( WS* NUMBER ( PERCENT | ) WS* ) ',' 
 				( WS* NUMBER ( PERCENT | ) WS* ) 
 		')'
-    | 	'rgb(' 	( WS* NUMBER ( PERCENT | ) WS* )
-				( WS* NUMBER ( PERCENT | ) WS* )
+    | 	'rgb(' 	( WS* NUMBER ( PERCENT | ) )
+				( WS* NUMBER ( PERCENT | ) )
 				( WS* NUMBER ( PERCENT | ) WS* ) 
 		')'
     ;