Author: bapt
Date: Thu Oct  6 19:51:30 2016
New Revision: 306783
URL: https://svnweb.freebsd.org/changeset/base/306783

Log:
  localedef: Improve cc_list parsing
  
  original commit log:
  =====
  I had originally suspected the parsing of ctype definition files as being
  the source of the ctype flag mis-definitions, but it wasn't.  In the
  process, I simplified the cc_list parsing so I'm committing the no-impact
  improvement separately.  It removes some parsing redundancies and
  won't parse partial range definitions anymore.
  ====
  
  Submitted by: marino
  Obtained from:        Dragonfly
  MFC after:    1 month

Modified:
  head/usr.bin/localedef/parser.y   (contents, props changed)

Modified: head/usr.bin/localedef/parser.y
==============================================================================
--- head/usr.bin/localedef/parser.y     Thu Oct  6 19:46:43 2016        
(r306782)
+++ head/usr.bin/localedef/parser.y     Thu Oct  6 19:51:30 2016        
(r306783)
@@ -27,6 +27,8 @@
  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
  */
 
 /*
@@ -321,21 +323,18 @@ ctype_kw  : T_ISUPPER cc_list T_NL
                | T_TOLOWER conv_list T_NL
                ;
 
+cc_list                : cc_list T_SEMI cc_range_end
+               | cc_list T_SEMI cc_char
+               | cc_char
+               ;
 
-cc_list                : cc_list T_SEMI T_CHAR
+cc_range_end   : T_ELLIPSIS T_SEMI T_CHAR
                {
-                       add_ctype($3);
+                       add_ctype_range($3);
                }
-               | cc_list T_SEMI T_SYMBOL
-               {
-                       add_charmap_undefined($3);
-               }
-               | cc_list T_SEMI T_ELLIPSIS T_SEMI T_CHAR
-               {
-                       /* note that the endpoints *must* be characters */
-                       add_ctype_range($5);
-               }
-               | T_CHAR
+               ;
+
+cc_char                : T_CHAR
                {
                        add_ctype($1);
                }
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to