[vlc-commits] [Git][videolan/vlc][master] 2 commits: webvtt: do not hardcode output file name

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Sun Nov 6 04:39:55 UTC 2022



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
682e335c by Marvin Scholz at 2022-11-06T04:13:51+00:00
webvtt: do not hardcode output file name

Instead of hardcoding the output file name in the
.l file, specify it on the command line instead.

In theory it would not be necessary to specify it at all as lex.yy.c
is the default, however overwriting the prefix will change this, so
we have to force it back to lex.yy.c so that ylwrap still works as
expected and can find the output file.

We do not hardcode it in the file anymore so that for Meson it can
properly specify the --outfile option and have it not overwritten by
the per-file option.

- - - - -
b252236c by Marvin Scholz at 2022-11-06T04:13:51+00:00
webvtt: make ambiguous character ranges case-sensitive

These ranges are already covering the relevant ranges without being
case-insensitive, but if they are case-sensitive, for locales that have
can deal with some characters in these ranges, it makes the range
ambiguous and results in warnings about this:

  CSSLexer.l:105: warning, the character range [?-?] is ambiguous in a
  case-insensitive scanner

- - - - -


2 changed files:

- modules/codec/Makefile.am
- modules/codec/webvtt/CSSLexer.l


Changes:

=====================================
modules/codec/Makefile.am
=====================================
@@ -240,6 +240,7 @@ if ENABLE_CSS
 # dependency: we need grammar build first
 BUILT_SOURCES += codec/webvtt/CSSGrammar.h
 libwebvtt_plugin_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/codec/webvtt/ -I$(builddir)/codec/webvtt/
+libwebvtt_plugin_la_LFLAGS = $(AM_LFLAGS) --outfile=lex.yy.c
 libwebvtt_plugin_la_SOURCES += codec/webvtt/CSSGrammar.y \
                                codec/webvtt/CSSLexer.l \
                                codec/webvtt/css_parser.c \
@@ -248,6 +249,7 @@ libwebvtt_plugin_la_SOURCES += codec/webvtt/CSSGrammar.y \
                                codec/webvtt/css_style.h \
                                codec/webvtt/css_bridge.h
 css_parser_test_CFLAGS = $(libwebvtt_plugin_la_CFLAGS)
+css_parser_test_LFLAGS = $(AM_LFLAGS) --outfile=lex.yy.c
 css_parser_test_SOURCES = codec/webvtt/css_test.c \
                           codec/webvtt/css_parser.c \
                           codec/webvtt/CSSGrammar.y \


=====================================
modules/codec/webvtt/CSSLexer.l
=====================================
@@ -25,7 +25,7 @@
 %option noinput
 %option never-interactive
 %option nostdinit
-%option prefix="css" outfile="lex.yy.c"
+%option prefix="css"
 
 %{
 #ifdef HAVE_CONFIG_H
@@ -39,10 +39,10 @@
 char *d;
 %}
 
-h		[0-9a-f]
-nonascii	[\200-\377]
+h		[0-9a-fA-F]
+nonascii	(?-i:[\200-\377])
 unicode		\\{h}{1,6}[ \t\r\n\f]?
-escape		{unicode}|\\[ -~\200-\377]
+escape		(?-i:{unicode}|\\[ -~\200-\377])
 nmstart		[a-z]|{nonascii}|{escape}
 nmchar		[a-z0-9-]|{nonascii}|{escape}
 string1		\"([\t !#$%&(-~]|\\{nl}|\'|{nonascii}|{escape})*\"



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/3e306e484814e2692c23bd7d3e0c9896a03fef82...b252236cff1c9cd0352f6fb5c7a128df8372368d

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/3e306e484814e2692c23bd7d3e0c9896a03fef82...b252236cff1c9cd0352f6fb5c7a128df8372368d
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list