diff options
author | Baptiste Daroussin <bapt@FreeBSD.org> | 2016-10-06 19:51:30 +0000 |
---|---|---|
committer | Baptiste Daroussin <bapt@FreeBSD.org> | 2016-10-06 19:51:30 +0000 |
commit | bbf9a4563017eb111ddcf08cf805f9821a6f0b4c (patch) | |
tree | 45d9691cfbeb323620401b6c15d4fb50bff7eda9 /usr.bin/localedef | |
parent | c7edf4fd0bc9fa6acdbd38d4fbe5dee2775f5346 (diff) | |
download | src-bbf9a4563017eb111ddcf08cf805f9821a6f0b4c.tar.gz src-bbf9a4563017eb111ddcf08cf805f9821a6f0b4c.zip |
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
Notes
Notes:
svn path=/head/; revision=306783
Diffstat (limited to 'usr.bin/localedef')
-rw-r--r-- | usr.bin/localedef/parser.y | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/usr.bin/localedef/parser.y b/usr.bin/localedef/parser.y index 87ff95d5e956..73bc6f902f39 100644 --- a/usr.bin/localedef/parser.y +++ b/usr.bin/localedef/parser.y @@ -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 - { - add_ctype($3); - } - | cc_list T_SEMI T_SYMBOL - { - add_charmap_undefined($3); - } - | cc_list T_SEMI T_ELLIPSIS T_SEMI T_CHAR +cc_range_end : T_ELLIPSIS T_SEMI T_CHAR { - /* note that the endpoints *must* be characters */ - add_ctype_range($5); + add_ctype_range($3); } - | T_CHAR + ; + +cc_char : T_CHAR { add_ctype($1); } |