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
This commit is contained in:
Baptiste Daroussin 2016-10-06 19:51:30 +00:00
parent c7edf4fd0b
commit bbf9a45630
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=306783

View File

@ -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);
}