mirror of
https://github.com/holub/mame
synced 2025-04-16 05:24:54 +03:00
Add Lua-cleaning ability to srcclean
This commit is contained in:
parent
e2978b793f
commit
234e91f9fb
@ -553,7 +553,7 @@ configuration { "Debug" }
|
||||
defines {
|
||||
"MAME_DEBUG",
|
||||
"MAME_PROFILER",
|
||||
-- "BGFX_CONFIG_DEBUG=1",
|
||||
-- "BGFX_CONFIG_DEBUG=1",
|
||||
}
|
||||
|
||||
if _OPTIONS["FASTDEBUG"]=="1" then
|
||||
|
@ -355,14 +355,14 @@ project "7z"
|
||||
configuration { "gmake or ninja" }
|
||||
buildoptions_c {
|
||||
"-Wno-undef",
|
||||
"-Wno-strict-prototypes",
|
||||
"-Wno-strict-prototypes",
|
||||
}
|
||||
|
||||
configuration { "mingw*" }
|
||||
buildoptions_c {
|
||||
"-Wno-strict-prototypes",
|
||||
}
|
||||
|
||||
|
||||
configuration { "vs*" }
|
||||
buildoptions {
|
||||
"/wd4100", -- warning C4100: 'xxx' : unreferenced formal parameter
|
||||
@ -743,9 +743,9 @@ end
|
||||
buildoptions_cpp {
|
||||
"-Wno-misleading-indentation",
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if _OPTIONS["targetos"]=="windows" then
|
||||
if _OPTIONS["gcc"]~=nil and string.find(_OPTIONS["gcc"], "clang") then
|
||||
buildoptions {
|
||||
@ -827,150 +827,150 @@ end
|
||||
--
|
||||
--if not _OPTIONS["with-system-portaudio"] then
|
||||
--project "portaudio"
|
||||
-- uuid "0755c5f5-eccf-47f3-98a9-df67018a94d4"
|
||||
-- kind "StaticLib"
|
||||
-- uuid "0755c5f5-eccf-47f3-98a9-df67018a94d4"
|
||||
-- kind "StaticLib"
|
||||
--
|
||||
-- configuration { "vs*" }
|
||||
-- buildoptions {
|
||||
-- "/wd4245", -- warning C4245: 'conversion' : conversion from 'type1' to 'type2', signed/unsigned mismatch
|
||||
-- "/wd4244", -- warning C4244: 'argument' : conversion from 'xxx' to 'xxx', possible loss of data
|
||||
-- "/wd4100", -- warning C4100: 'xxx' : unreferenced formal parameter
|
||||
-- "/wd4389", -- warning C4389: 'operator' : signed/unsigned mismatch
|
||||
-- "/wd4189", -- warning C4189: 'xxx' : local variable is initialized but not referenced
|
||||
-- "/wd4127", -- warning C4127: conditional expression is constant
|
||||
-- }
|
||||
-- configuration { "vs*" }
|
||||
-- buildoptions {
|
||||
-- "/wd4245", -- warning C4245: 'conversion' : conversion from 'type1' to 'type2', signed/unsigned mismatch
|
||||
-- "/wd4244", -- warning C4244: 'argument' : conversion from 'xxx' to 'xxx', possible loss of data
|
||||
-- "/wd4100", -- warning C4100: 'xxx' : unreferenced formal parameter
|
||||
-- "/wd4389", -- warning C4389: 'operator' : signed/unsigned mismatch
|
||||
-- "/wd4189", -- warning C4189: 'xxx' : local variable is initialized but not referenced
|
||||
-- "/wd4127", -- warning C4127: conditional expression is constant
|
||||
-- }
|
||||
--if _OPTIONS["vs"]=="intel-15" then
|
||||
-- buildoptions {
|
||||
-- "/Qwd869", -- remark #869: parameter "xxx" was never referenced
|
||||
-- "/Qwd1478", -- warning #1478: function "xxx" (declared at line yyy of "zzz") was declared deprecated
|
||||
-- "/Qwd2544", -- message #2544: empty dependent statement in if-statement
|
||||
-- "/Qwd1879", -- warning #1879: unimplemented pragma ignored
|
||||
-- }
|
||||
-- buildoptions {
|
||||
-- "/Qwd869", -- remark #869: parameter "xxx" was never referenced
|
||||
-- "/Qwd1478", -- warning #1478: function "xxx" (declared at line yyy of "zzz") was declared deprecated
|
||||
-- "/Qwd2544", -- message #2544: empty dependent statement in if-statement
|
||||
-- "/Qwd1879", -- warning #1879: unimplemented pragma ignored
|
||||
-- }
|
||||
--end
|
||||
-- configuration { "vs2015*" }
|
||||
-- buildoptions {
|
||||
-- "/wd4456", -- warning C4456: declaration of 'xxx' hides previous local declaration
|
||||
-- }
|
||||
-- configuration { "vs2015*" }
|
||||
-- buildoptions {
|
||||
-- "/wd4456", -- warning C4456: declaration of 'xxx' hides previous local declaration
|
||||
-- }
|
||||
--
|
||||
-- configuration { "gmake or ninja" }
|
||||
-- buildoptions_c {
|
||||
-- "-Wno-strict-prototypes",
|
||||
-- "-Wno-bad-function-cast",
|
||||
-- "-Wno-undef",
|
||||
-- "-Wno-missing-braces",
|
||||
-- "-Wno-unused-variable",
|
||||
-- "-Wno-unused-value",
|
||||
-- "-Wno-unused-function",
|
||||
-- "-Wno-unknown-pragmas",
|
||||
-- }
|
||||
-- configuration { "gmake or ninja" }
|
||||
-- buildoptions_c {
|
||||
-- "-Wno-strict-prototypes",
|
||||
-- "-Wno-bad-function-cast",
|
||||
-- "-Wno-undef",
|
||||
-- "-Wno-missing-braces",
|
||||
-- "-Wno-unused-variable",
|
||||
-- "-Wno-unused-value",
|
||||
-- "-Wno-unused-function",
|
||||
-- "-Wno-unknown-pragmas",
|
||||
-- }
|
||||
--
|
||||
-- local version = str_to_version(_OPTIONS["gcc_version"])
|
||||
-- if (_OPTIONS["gcc"]~=nil) then
|
||||
-- if string.find(_OPTIONS["gcc"], "clang") or string.find(_OPTIONS["gcc"], "android") then
|
||||
-- buildoptions_c {
|
||||
-- "-Wno-unknown-warning-option",
|
||||
-- "-Wno-absolute-value",
|
||||
-- "-Wno-unused-but-set-variable",
|
||||
-- "-Wno-maybe-uninitialized",
|
||||
-- "-Wno-sometimes-uninitialized",
|
||||
-- }
|
||||
-- else
|
||||
-- if (version >= 40600) then
|
||||
-- buildoptions_c {
|
||||
-- "-Wno-unused-but-set-variable",
|
||||
-- "-Wno-maybe-uninitialized",
|
||||
-- "-Wno-sometimes-uninitialized",
|
||||
-- }
|
||||
-- end
|
||||
-- end
|
||||
-- end
|
||||
-- configuration { "vs*" }
|
||||
-- buildoptions {
|
||||
-- "/wd4204", -- warning C4204: nonstandard extension used : non-constant aggregate initializer
|
||||
-- "/wd4701", -- warning C4701: potentially uninitialized local variable 'xxx' used
|
||||
-- }
|
||||
-- local version = str_to_version(_OPTIONS["gcc_version"])
|
||||
-- if (_OPTIONS["gcc"]~=nil) then
|
||||
-- if string.find(_OPTIONS["gcc"], "clang") or string.find(_OPTIONS["gcc"], "android") then
|
||||
-- buildoptions_c {
|
||||
-- "-Wno-unknown-warning-option",
|
||||
-- "-Wno-absolute-value",
|
||||
-- "-Wno-unused-but-set-variable",
|
||||
-- "-Wno-maybe-uninitialized",
|
||||
-- "-Wno-sometimes-uninitialized",
|
||||
-- }
|
||||
-- else
|
||||
-- if (version >= 40600) then
|
||||
-- buildoptions_c {
|
||||
-- "-Wno-unused-but-set-variable",
|
||||
-- "-Wno-maybe-uninitialized",
|
||||
-- "-Wno-sometimes-uninitialized",
|
||||
-- }
|
||||
-- end
|
||||
-- end
|
||||
-- end
|
||||
-- configuration { "vs*" }
|
||||
-- buildoptions {
|
||||
-- "/wd4204", -- warning C4204: nonstandard extension used : non-constant aggregate initializer
|
||||
-- "/wd4701", -- warning C4701: potentially uninitialized local variable 'xxx' used
|
||||
-- }
|
||||
--
|
||||
-- configuration { }
|
||||
-- configuration { }
|
||||
--
|
||||
-- includedirs {
|
||||
-- MAME_DIR .. "3rdparty/portaudio/include",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/common",
|
||||
-- }
|
||||
-- includedirs {
|
||||
-- MAME_DIR .. "3rdparty/portaudio/include",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/common",
|
||||
-- }
|
||||
--
|
||||
-- files {
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/common/pa_allocation.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/common/pa_converters.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/common/pa_cpuload.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/common/pa_dither.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/common/pa_debugprint.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/common/pa_front.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/common/pa_process.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/common/pa_stream.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/common/pa_trace.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/hostapi/skeleton/pa_hostapi_skeleton.c",
|
||||
-- }
|
||||
-- files {
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/common/pa_allocation.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/common/pa_converters.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/common/pa_cpuload.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/common/pa_dither.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/common/pa_debugprint.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/common/pa_front.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/common/pa_process.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/common/pa_stream.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/common/pa_trace.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/hostapi/skeleton/pa_hostapi_skeleton.c",
|
||||
-- }
|
||||
--
|
||||
-- if _OPTIONS["targetos"]=="windows" then
|
||||
-- defines {
|
||||
-- "PA_USE_DS=1",
|
||||
-- "PA_USE_WDMKS=1",
|
||||
-- "PA_USE_WMME=1",
|
||||
-- }
|
||||
-- includedirs {
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/os/win",
|
||||
-- }
|
||||
-- if _OPTIONS["targetos"]=="windows" then
|
||||
-- defines {
|
||||
-- "PA_USE_DS=1",
|
||||
-- "PA_USE_WDMKS=1",
|
||||
-- "PA_USE_WMME=1",
|
||||
-- }
|
||||
-- includedirs {
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/os/win",
|
||||
-- }
|
||||
--
|
||||
-- configuration { }
|
||||
-- files {
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/os/win/pa_win_util.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/os/win/pa_win_waveformat.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/os/win/pa_win_hostapis.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/os/win/pa_win_wdmks_utils.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/os/win/pa_win_coinitialize.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/hostapi/dsound/pa_win_ds.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/hostapi/dsound/pa_win_ds_dynlink.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/hostapi/wdmks/pa_win_wdmks.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/common/pa_ringbuffer.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/hostapi/wmme/pa_win_wmme.c",
|
||||
-- }
|
||||
-- configuration { }
|
||||
-- files {
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/os/win/pa_win_util.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/os/win/pa_win_waveformat.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/os/win/pa_win_hostapis.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/os/win/pa_win_wdmks_utils.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/os/win/pa_win_coinitialize.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/hostapi/dsound/pa_win_ds.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/hostapi/dsound/pa_win_ds_dynlink.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/hostapi/wdmks/pa_win_wdmks.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/common/pa_ringbuffer.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/hostapi/wmme/pa_win_wmme.c",
|
||||
-- }
|
||||
--
|
||||
-- end
|
||||
-- if _OPTIONS["targetos"]=="linux" then
|
||||
-- defines {
|
||||
-- "PA_USE_ALSA=1",
|
||||
-- "PA_USE_OSS=1",
|
||||
-- "HAVE_LINUX_SOUNDCARD_H",
|
||||
-- }
|
||||
-- includedirs {
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/os/unix",
|
||||
-- }
|
||||
-- files {
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/os/unix/pa_unix_hostapis.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/os/unix/pa_unix_util.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/hostapi/alsa/pa_linux_alsa.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/hostapi/oss/pa_unix_oss.c",
|
||||
-- }
|
||||
-- end
|
||||
-- if _OPTIONS["targetos"]=="macosx" then
|
||||
-- defines {
|
||||
-- "PA_USE_COREAUDIO=1",
|
||||
-- }
|
||||
-- includedirs {
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/os/unix",
|
||||
-- }
|
||||
-- files {
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/os/unix/pa_unix_hostapis.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/os/unix/pa_unix_util.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/hostapi/coreaudio/pa_mac_core.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/hostapi/coreaudio/pa_mac_core_utilities.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/hostapi/coreaudio/pa_mac_core_blocking.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/common/pa_ringbuffer.c",
|
||||
-- }
|
||||
-- end
|
||||
-- end
|
||||
-- if _OPTIONS["targetos"]=="linux" then
|
||||
-- defines {
|
||||
-- "PA_USE_ALSA=1",
|
||||
-- "PA_USE_OSS=1",
|
||||
-- "HAVE_LINUX_SOUNDCARD_H",
|
||||
-- }
|
||||
-- includedirs {
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/os/unix",
|
||||
-- }
|
||||
-- files {
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/os/unix/pa_unix_hostapis.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/os/unix/pa_unix_util.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/hostapi/alsa/pa_linux_alsa.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/hostapi/oss/pa_unix_oss.c",
|
||||
-- }
|
||||
-- end
|
||||
-- if _OPTIONS["targetos"]=="macosx" then
|
||||
-- defines {
|
||||
-- "PA_USE_COREAUDIO=1",
|
||||
-- }
|
||||
-- includedirs {
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/os/unix",
|
||||
-- }
|
||||
-- files {
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/os/unix/pa_unix_hostapis.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/os/unix/pa_unix_util.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/hostapi/coreaudio/pa_mac_core.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/hostapi/coreaudio/pa_mac_core_utilities.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/hostapi/coreaudio/pa_mac_core_blocking.c",
|
||||
-- MAME_DIR .. "3rdparty/portaudio/src/common/pa_ringbuffer.c",
|
||||
-- }
|
||||
-- end
|
||||
--
|
||||
--else
|
||||
--links {
|
||||
-- ext_lib("portaudio"),
|
||||
-- ext_lib("portaudio"),
|
||||
--}
|
||||
--end
|
||||
|
||||
@ -1165,7 +1165,7 @@ project "uv"
|
||||
links {
|
||||
"kvm",
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
if (_OPTIONS["SHADOW_CHECK"]=="1") then
|
||||
removebuildoptions {
|
||||
|
@ -2863,7 +2863,7 @@ end
|
||||
if (BUSES["HP_OPTROM"]~=null) then
|
||||
files {
|
||||
MAME_DIR .. "src/devices/bus/hp_optroms/hp_optrom.cpp",
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
---------------------------------------------------
|
||||
@ -2877,5 +2877,5 @@ if (BUSES["COMPIS_GRAPHICS"]~=null) then
|
||||
MAME_DIR .. "src/devices/bus/compis/graphics.h",
|
||||
MAME_DIR .. "src/devices/bus/compis/hrg.cpp",
|
||||
MAME_DIR .. "src/devices/bus/compis/hrg.h",
|
||||
}
|
||||
}
|
||||
end
|
||||
|
@ -112,7 +112,7 @@ files {
|
||||
MAME_DIR .. "src/emu/emucore.cpp",
|
||||
MAME_DIR .. "src/emu/emucore.h",
|
||||
MAME_DIR .. "src/emu/emumem.cpp",
|
||||
MAME_DIR .. "src/emu/emumem.h",
|
||||
MAME_DIR .. "src/emu/emumem.h",
|
||||
MAME_DIR .. "src/emu/emuopts.cpp",
|
||||
MAME_DIR .. "src/emu/emuopts.h",
|
||||
MAME_DIR .. "src/emu/emupal.cpp",
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -223,7 +223,7 @@ end
|
||||
ext_lib("jpeg"),
|
||||
"7z",
|
||||
}
|
||||
if (STANDALONE~=true) then
|
||||
if (STANDALONE~=true) then
|
||||
links {
|
||||
ext_lib("lua"),
|
||||
"lualibs",
|
||||
@ -267,11 +267,11 @@ end
|
||||
ext_includedir("flac"),
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (STANDALONE==true) then
|
||||
standalone();
|
||||
end
|
||||
|
||||
|
||||
if (STANDALONE~=true) then
|
||||
if _OPTIONS["targetos"]=="macosx" and (not override_resources) then
|
||||
linkoptions {
|
||||
@ -378,6 +378,6 @@ end
|
||||
debugargs (_OPTIONS["DEBUG_ARGS"])
|
||||
else
|
||||
debugargs ("-window")
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -14,8 +14,8 @@ project "netlist"
|
||||
kind (LIBTYPE)
|
||||
|
||||
addprojectflags()
|
||||
|
||||
|
||||
|
||||
|
||||
defines {
|
||||
"__STDC_CONSTANT_MACROS",
|
||||
}
|
||||
@ -43,14 +43,14 @@ project "netlist"
|
||||
MAME_DIR .. "src/lib/netlist/plib/pconfig.h",
|
||||
MAME_DIR .. "src/lib/netlist/plib/palloc.cpp",
|
||||
MAME_DIR .. "src/lib/netlist/plib/palloc.h",
|
||||
MAME_DIR .. "src/lib/netlist/plib/pchrono.cpp",
|
||||
MAME_DIR .. "src/lib/netlist/plib/pchrono.h",
|
||||
MAME_DIR .. "src/lib/netlist/plib/pchrono.cpp",
|
||||
MAME_DIR .. "src/lib/netlist/plib/pchrono.h",
|
||||
MAME_DIR .. "src/lib/netlist/plib/pfmtlog.cpp",
|
||||
MAME_DIR .. "src/lib/netlist/plib/pfmtlog.h",
|
||||
MAME_DIR .. "src/lib/netlist/plib/plists.h",
|
||||
MAME_DIR .. "src/lib/netlist/plib/pdynlib.cpp",
|
||||
MAME_DIR .. "src/lib/netlist/plib/pdynlib.h",
|
||||
MAME_DIR .. "src/lib/netlist/plib/poptions.cpp",
|
||||
MAME_DIR .. "src/lib/netlist/plib/pdynlib.cpp",
|
||||
MAME_DIR .. "src/lib/netlist/plib/pdynlib.h",
|
||||
MAME_DIR .. "src/lib/netlist/plib/poptions.cpp",
|
||||
MAME_DIR .. "src/lib/netlist/plib/poptions.h",
|
||||
MAME_DIR .. "src/lib/netlist/plib/pparser.cpp",
|
||||
MAME_DIR .. "src/lib/netlist/plib/pparser.h",
|
||||
@ -63,8 +63,8 @@ project "netlist"
|
||||
MAME_DIR .. "src/lib/netlist/plib/pstream.cpp",
|
||||
MAME_DIR .. "src/lib/netlist/plib/pstream.h",
|
||||
MAME_DIR .. "src/lib/netlist/plib/ptypes.h",
|
||||
MAME_DIR .. "src/lib/netlist/plib/putil.cpp",
|
||||
MAME_DIR .. "src/lib/netlist/plib/putil.h",
|
||||
MAME_DIR .. "src/lib/netlist/plib/putil.cpp",
|
||||
MAME_DIR .. "src/lib/netlist/plib/putil.h",
|
||||
MAME_DIR .. "src/lib/netlist/tools/nl_convert.cpp",
|
||||
MAME_DIR .. "src/lib/netlist/tools/nl_convert.h",
|
||||
MAME_DIR .. "src/lib/netlist/analog/nld_bjt.cpp",
|
||||
@ -147,8 +147,8 @@ project "netlist"
|
||||
MAME_DIR .. "src/lib/netlist/devices/nld_system.h",
|
||||
MAME_DIR .. "src/lib/netlist/devices/nld_truthtable.cpp",
|
||||
MAME_DIR .. "src/lib/netlist/devices/nld_truthtable.h",
|
||||
MAME_DIR .. "src/lib/netlist/devices/nlid_cmos.h",
|
||||
MAME_DIR .. "src/lib/netlist/devices/nlid_system.h",
|
||||
MAME_DIR .. "src/lib/netlist/devices/nlid_cmos.h",
|
||||
MAME_DIR .. "src/lib/netlist/devices/nlid_system.h",
|
||||
MAME_DIR .. "src/lib/netlist/macro/nlm_ttl74xx.cpp",
|
||||
MAME_DIR .. "src/lib/netlist/macro/nlm_ttl74xx.h",
|
||||
MAME_DIR .. "src/lib/netlist/macro/nlm_cd4xxx.cpp",
|
||||
|
@ -37,8 +37,8 @@ end
|
||||
|
||||
function pkgconfigcmd()
|
||||
local pkgconfig = os.getenv("PKG_CONFIG")
|
||||
if pkgconfig == nil then
|
||||
return "pkg-config"
|
||||
if pkgconfig == nil then
|
||||
return "pkg-config"
|
||||
end
|
||||
return pkgconfig
|
||||
end
|
||||
|
@ -257,7 +257,7 @@ project ("ocore_" .. _OPTIONS["osd"])
|
||||
MAME_DIR .. "src/osd/modules/file/winsocket.cpp",
|
||||
MAME_DIR .. "src/osd/modules/lib/osdlib_win32.cpp",
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------
|
||||
|
@ -2132,9 +2132,9 @@ files {
|
||||
MAME_DIR .. "src/mame/drivers/ddribble.cpp",
|
||||
MAME_DIR .. "src/mame/includes/ddribble.h",
|
||||
MAME_DIR .. "src/mame/video/ddribble.cpp",
|
||||
MAME_DIR .. "src/mame/drivers/divebomb.cpp",
|
||||
MAME_DIR .. "src/mame/includes/divebomb.h",
|
||||
MAME_DIR .. "src/mame/video/divebomb.cpp",
|
||||
MAME_DIR .. "src/mame/drivers/divebomb.cpp",
|
||||
MAME_DIR .. "src/mame/includes/divebomb.h",
|
||||
MAME_DIR .. "src/mame/video/divebomb.cpp",
|
||||
MAME_DIR .. "src/mame/drivers/djmain.cpp",
|
||||
MAME_DIR .. "src/mame/includes/djmain.h",
|
||||
MAME_DIR .. "src/mame/video/djmain.cpp",
|
||||
@ -3931,9 +3931,9 @@ files {
|
||||
MAME_DIR .. "src/mame/video/slapfght.cpp",
|
||||
MAME_DIR .. "src/mame/drivers/snowbros.cpp",
|
||||
MAME_DIR .. "src/mame/includes/snowbros.h",
|
||||
MAME_DIR .. "src/mame/video/snowbros.cpp",
|
||||
MAME_DIR .. "src/mame/video/snowbros.cpp",
|
||||
MAME_DIR .. "src/mame/video/kan_pand.cpp",
|
||||
MAME_DIR .. "src/mame/video/kan_pand.h",
|
||||
MAME_DIR .. "src/mame/video/kan_pand.h",
|
||||
MAME_DIR .. "src/mame/drivers/toaplan1.cpp",
|
||||
MAME_DIR .. "src/mame/includes/toaplan1.h",
|
||||
MAME_DIR .. "src/mame/machine/toaplan1.cpp",
|
||||
|
@ -124,7 +124,7 @@ files{
|
||||
MAME_DIR .. "src/mame/includes/mario.h",
|
||||
MAME_DIR .. "src/mame/video/mario.cpp",
|
||||
MAME_DIR .. "src/mame/audio/mario.cpp",
|
||||
|
||||
|
||||
MAME_DIR .. "src/mame/drivers/m62.cpp",
|
||||
MAME_DIR .. "src/mame/includes/m62.h",
|
||||
MAME_DIR .. "src/mame/video/m62.cpp",
|
||||
|
@ -3,10 +3,10 @@ STANDALONE = true
|
||||
CPUS["Z80"] = true
|
||||
|
||||
function standalone()
|
||||
files{
|
||||
files{
|
||||
MAME_DIR .. "src/zexall/main.cpp",
|
||||
MAME_DIR .. "src/zexall/zexall.cpp",
|
||||
MAME_DIR .. "src/zexall/zexall.h",
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
|
@ -3596,7 +3596,7 @@ GAME_CUSTOM( 199?, m4luckst__b, m4luckst, "ls15t", 0x0000, 0
|
||||
DRIVER_INIT_MEMBER(mpu4_state,m4tenten)
|
||||
{
|
||||
DRIVER_INIT_CALL(m4default);
|
||||
// DRIVER_INIT_CALL(m4_showstring);
|
||||
// DRIVER_INIT_CALL(m4_showstring);
|
||||
//Derived from 10_x_10_(Barcrest)_[C01_v1-0_1024_10jp].gam
|
||||
DRIVER_INIT_CALL(m4_hopper_duart_a);
|
||||
DRIVER_INIT_CALL(m4default_reels);
|
||||
@ -3717,7 +3717,7 @@ DRIVER_INIT_MEMBER(mpu4_state,m4andyfh)
|
||||
{
|
||||
//Derived from Andy's_Full_House_(Barcrest)_[C01_800_10jp].gam
|
||||
DRIVER_INIT_CALL(m4default);
|
||||
// DRIVER_INIT_CALL(m4_showstring);
|
||||
// DRIVER_INIT_CALL(m4_showstring);
|
||||
DRIVER_INIT_CALL(m4_hopper_tubes);
|
||||
DRIVER_INIT_CALL(m4default_reels);
|
||||
//PCKEY =b
|
||||
|
@ -29,6 +29,13 @@
|
||||
"bad\\
|
||||
tbehaviour"
|
||||
|
||||
Known Lua limitations:
|
||||
* Whitespace normalisation is applied inside long string literals
|
||||
which can cause changes in behaviour
|
||||
* Disabled code inside long comments gets no special treatment and
|
||||
may have spacing adjusted in a way that affects behaviour when
|
||||
uncommented
|
||||
|
||||
Known XML limitations:
|
||||
* No special handling for CDATA
|
||||
* No special handling for processing instructions
|
||||
@ -88,9 +95,17 @@ public:
|
||||
virtual void summarise(std::ostream &os) const;
|
||||
|
||||
protected:
|
||||
static constexpr unicode_char HORIZONTAL_TAB = 0x0000'0009U;
|
||||
static constexpr unicode_char LINE_FEED = 0x0000'000aU;
|
||||
static constexpr unicode_char SPACE = 0x0000'0020U;
|
||||
static constexpr unicode_char HORIZONTAL_TAB = 0x0000'0009U;
|
||||
static constexpr unicode_char LINE_FEED = 0x0000'000aU;
|
||||
static constexpr unicode_char VERTICAL_TAB = 0x0000'000bU;
|
||||
static constexpr unicode_char SPACE = 0x0000'0020U;
|
||||
static constexpr unicode_char DOUBLE_QUOTE = 0x0000'0022U;
|
||||
static constexpr unicode_char SINGLE_QUOTE = 0x0000'0027U;
|
||||
static constexpr unicode_char HYPHEN_MINUS = 0x0000'002dU;
|
||||
static constexpr unicode_char QUESTION_MARK = 0x0000'003fU;
|
||||
static constexpr unicode_char BACKSLASH = 0x0000'005cU;
|
||||
static constexpr unicode_char BASIC_LATIN_LAST = 0x0000'007fU;
|
||||
static constexpr unicode_char CYRILLIC_SUPPLEMENT_LAST = 0x0000'052fU;
|
||||
|
||||
template <typename OutputIt>
|
||||
cleaner_base(OutputIt &&output, newline newline_mode, unsigned tab_width);
|
||||
@ -805,32 +820,26 @@ protected:
|
||||
void output_character(unicode_char ch);
|
||||
|
||||
private:
|
||||
static constexpr unicode_char DOUBLE_QUOTE = 0x0000'0022U;
|
||||
static constexpr unicode_char SINGLE_QUOTE = 0x0000'0027U;
|
||||
static constexpr unicode_char ASTERISK = 0x0000'002aU;
|
||||
static constexpr unicode_char SLASH = 0x0000'002fU;
|
||||
static constexpr unicode_char QUESTION_MARK = 0x0000'003fU;
|
||||
static constexpr unicode_char UPPERCASE_FIRST = 0x0000'0041U;
|
||||
static constexpr unicode_char UPPERCASE_B = 0x0000'0042U;
|
||||
static constexpr unicode_char UPPERCASE_X = 0x0000'0058U;
|
||||
static constexpr unicode_char UPPERCASE_LAST = 0x0000'005aU;
|
||||
static constexpr unicode_char BACKSLASH = 0x0000'005cU;
|
||||
static constexpr unicode_char UNDERSCORE = 0x0000'005fU;
|
||||
static constexpr unicode_char LOWERCASE_FIRST = 0x0000'0061U;
|
||||
static constexpr unicode_char LOWERCASE_B = 0x0000'0062U;
|
||||
static constexpr unicode_char LOWERCASE_X = 0x0000'0078U;
|
||||
static constexpr unicode_char LOWERCASE_LAST = 0x0000'007aU;
|
||||
static constexpr unicode_char BASIC_LATIN_LAST = 0x0000'007fU;
|
||||
static constexpr unicode_char CYRILLIC_SUPPLEMENT_LAST = 0x0000'052fU;
|
||||
static constexpr unicode_char ASTERISK = 0x0000'002aU;
|
||||
static constexpr unicode_char SLASH = 0x0000'002fU;
|
||||
static constexpr unicode_char UPPERCASE_FIRST = 0x0000'0041U;
|
||||
static constexpr unicode_char UPPERCASE_B = 0x0000'0042U;
|
||||
static constexpr unicode_char UPPERCASE_X = 0x0000'0058U;
|
||||
static constexpr unicode_char UPPERCASE_LAST = 0x0000'005aU;
|
||||
static constexpr unicode_char UNDERSCORE = 0x0000'005fU;
|
||||
static constexpr unicode_char LOWERCASE_FIRST = 0x0000'0061U;
|
||||
static constexpr unicode_char LOWERCASE_B = 0x0000'0062U;
|
||||
static constexpr unicode_char LOWERCASE_X = 0x0000'0078U;
|
||||
static constexpr unicode_char LOWERCASE_LAST = 0x0000'007aU;
|
||||
|
||||
static constexpr unicode_char DIGIT_FIRST = 0x0000'0030U;
|
||||
static constexpr unicode_char DIGIT_BINARY_LAST = 0x0000'0031U;
|
||||
static constexpr unicode_char DIGIT_OCTAL_LAST = 0x0000'0037U;
|
||||
static constexpr unicode_char DIGIT_DECIMAL_LAST = 0x0000'0039U;
|
||||
static constexpr unicode_char DIGIT_HEX_UPPER_FIRST = 0x0000'0041U;
|
||||
static constexpr unicode_char DIGIT_HEX_UPPER_LAST = 0x0000'0046U;
|
||||
static constexpr unicode_char DIGIT_HEX_LOWER_FIRST = 0x0000'0061U;
|
||||
static constexpr unicode_char DIGIT_HEX_LOWER_LAST = 0x0000'0066U;
|
||||
static constexpr unicode_char DIGIT_FIRST = 0x0000'0030U;
|
||||
static constexpr unicode_char DIGIT_BINARY_LAST = 0x0000'0031U;
|
||||
static constexpr unicode_char DIGIT_OCTAL_LAST = 0x0000'0037U;
|
||||
static constexpr unicode_char DIGIT_DECIMAL_LAST = 0x0000'0039U;
|
||||
static constexpr unicode_char DIGIT_HEX_UPPER_FIRST = 0x0000'0041U;
|
||||
static constexpr unicode_char DIGIT_HEX_UPPER_LAST = 0x0000'0046U;
|
||||
static constexpr unicode_char DIGIT_HEX_LOWER_FIRST = 0x0000'0061U;
|
||||
static constexpr unicode_char DIGIT_HEX_LOWER_LAST = 0x0000'0066U;
|
||||
|
||||
enum class parse_state
|
||||
{
|
||||
@ -1060,8 +1069,17 @@ void cpp_cleaner::process_characters(unicode_char const *begin, unicode_char con
|
||||
void cpp_cleaner::input_complete()
|
||||
{
|
||||
flush_tail();
|
||||
if (parse_state::COMMENT == m_parse_state)
|
||||
switch (m_parse_state)
|
||||
{
|
||||
case parse_state::COMMENT:
|
||||
throw std::runtime_error(util::string_format("unterminated multi-line comment beginning on line %1$u", m_comment_line));
|
||||
case parse_state::CHARACTER_CONSTANT:
|
||||
throw std::runtime_error(util::string_format("unterminated character literal on line %1$u", m_input_line));
|
||||
case parse_state::STRING_CONSTANT:
|
||||
throw std::runtime_error(util::string_format("unterminated string literal on line %1$u", m_input_line));
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1188,6 +1206,12 @@ void cpp_cleaner::process_text(unicode_char ch)
|
||||
throw std::runtime_error(util::string_format("unterminated string literal on line %1$u", m_input_line));
|
||||
}
|
||||
break;
|
||||
case VERTICAL_TAB:
|
||||
++m_tabs_escaped;
|
||||
if (!m_escape)
|
||||
output_character(BACKSLASH);
|
||||
output_character(unicode_char(std::uint8_t('v')));
|
||||
break;
|
||||
default:
|
||||
output_character(ch);
|
||||
if (!m_escape && (((parse_state::STRING_CONSTANT == m_parse_state) ? DOUBLE_QUOTE : SINGLE_QUOTE) == ch))
|
||||
@ -1299,6 +1323,324 @@ void cpp_cleaner::process_numeric(unicode_char ch)
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
LUA SOURCE CLEANER CLASS
|
||||
***************************************************************************/
|
||||
|
||||
class lua_cleaner : public cleaner_base
|
||||
{
|
||||
public:
|
||||
template <typename OutputIt>
|
||||
lua_cleaner(OutputIt &&output, newline newline_mode, unsigned tab_width);
|
||||
|
||||
virtual bool affected() const override;
|
||||
virtual void summarise(std::ostream &os) const override;
|
||||
|
||||
protected:
|
||||
void output_character(unicode_char ch);
|
||||
|
||||
private:
|
||||
static constexpr unicode_char EQUALS = 0x0000'003dU;
|
||||
static constexpr unicode_char LEFT_BRACKET = 0x0000'005bU;
|
||||
static constexpr unicode_char RIGHT_BRACKET = 0x0000'005dU;
|
||||
|
||||
enum class parse_state
|
||||
{
|
||||
DEFAULT,
|
||||
SHORT_COMMENT,
|
||||
LONG_COMMENT,
|
||||
STRING_CONSTANT,
|
||||
LONG_STRING_CONSTANT
|
||||
};
|
||||
|
||||
virtual void process_characters(unicode_char const *begin, unicode_char const *end) override;
|
||||
virtual void input_complete() override;
|
||||
|
||||
void process_default(unicode_char ch);
|
||||
void process_short_comment(unicode_char ch);
|
||||
void process_long_comment(unicode_char ch);
|
||||
void process_string_constant(unicode_char ch);
|
||||
void process_long_string_constant(unicode_char ch);
|
||||
|
||||
parse_state m_parse_state;
|
||||
std::uint64_t m_input_line;
|
||||
int m_long_bracket_level;
|
||||
bool m_escape;
|
||||
std::uint32_t m_block_line;
|
||||
int m_block_level;
|
||||
bool m_comment_start;
|
||||
unicode_char m_string_quote;
|
||||
|
||||
std::uint64_t m_tabs_escaped = 0U;
|
||||
std::uint64_t m_newlines_escaped = 0U;
|
||||
std::uint64_t m_non_ascii = 0U;
|
||||
};
|
||||
|
||||
|
||||
template <typename OutputIt>
|
||||
lua_cleaner::lua_cleaner(
|
||||
OutputIt &&output,
|
||||
newline newline_mode,
|
||||
unsigned tab_width)
|
||||
: cleaner_base(std::forward<OutputIt>(output), newline_mode, tab_width)
|
||||
, m_parse_state(parse_state::DEFAULT)
|
||||
, m_input_line(1U)
|
||||
, m_long_bracket_level(-1)
|
||||
, m_escape(false)
|
||||
, m_block_line(0U)
|
||||
, m_block_level(0)
|
||||
, m_comment_start(false)
|
||||
, m_string_quote(0U)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
bool lua_cleaner::affected() const
|
||||
{
|
||||
return
|
||||
cleaner_base::affected() ||
|
||||
m_tabs_escaped ||
|
||||
m_newlines_escaped ||
|
||||
m_non_ascii;
|
||||
}
|
||||
|
||||
|
||||
void lua_cleaner::summarise(std::ostream &os) const
|
||||
{
|
||||
cleaner_base::summarise(os);
|
||||
if (m_tabs_escaped)
|
||||
util::stream_format(os, "%1$u tab(s) escaped\n", m_tabs_escaped);
|
||||
if (m_newlines_escaped)
|
||||
util::stream_format(os, "%1$u escaped line ending(s) converted\n", m_newlines_escaped);
|
||||
if (m_non_ascii)
|
||||
util::stream_format(os, "%1$u non-ASCII character(s) replaced\n", m_non_ascii);
|
||||
}
|
||||
|
||||
|
||||
void lua_cleaner::output_character(unicode_char ch)
|
||||
{
|
||||
switch (m_parse_state)
|
||||
{
|
||||
case parse_state::DEFAULT:
|
||||
if (BASIC_LATIN_LAST < ch)
|
||||
{
|
||||
++m_non_ascii;
|
||||
ch = QUESTION_MARK;
|
||||
}
|
||||
break;
|
||||
case parse_state::SHORT_COMMENT:
|
||||
case parse_state::LONG_COMMENT:
|
||||
break;
|
||||
case parse_state::STRING_CONSTANT:
|
||||
case parse_state::LONG_STRING_CONSTANT:
|
||||
if (CYRILLIC_SUPPLEMENT_LAST < ch)
|
||||
{
|
||||
++m_non_ascii;
|
||||
ch = QUESTION_MARK;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
cleaner_base::output_character(ch);
|
||||
}
|
||||
|
||||
|
||||
void lua_cleaner::process_characters(unicode_char const *begin, unicode_char const *end)
|
||||
{
|
||||
while (begin != end)
|
||||
{
|
||||
unicode_char const ch(*begin++);
|
||||
switch (m_parse_state)
|
||||
{
|
||||
case parse_state::DEFAULT:
|
||||
process_default(ch);
|
||||
break;
|
||||
case parse_state::SHORT_COMMENT:
|
||||
process_short_comment(ch);
|
||||
break;
|
||||
case parse_state::LONG_COMMENT:
|
||||
process_long_comment(ch);
|
||||
break;
|
||||
case parse_state::STRING_CONSTANT:
|
||||
process_string_constant(ch);
|
||||
break;
|
||||
case parse_state::LONG_STRING_CONSTANT:
|
||||
process_long_string_constant(ch);
|
||||
break;
|
||||
}
|
||||
|
||||
if (LINE_FEED == ch)
|
||||
++m_input_line;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void lua_cleaner::input_complete()
|
||||
{
|
||||
switch (m_parse_state)
|
||||
{
|
||||
case parse_state::LONG_COMMENT:
|
||||
throw std::runtime_error(util::string_format("unterminated long comment beginning on line %1$u", m_block_line));
|
||||
case parse_state::STRING_CONSTANT:
|
||||
throw std::runtime_error(util::string_format("unterminated string literal on line %1$u", m_input_line));
|
||||
case parse_state::LONG_STRING_CONSTANT:
|
||||
throw std::runtime_error(util::string_format("unterminated long string literal beginning on line %1$u", m_block_line));
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void lua_cleaner::process_default(unicode_char ch)
|
||||
{
|
||||
switch (ch)
|
||||
{
|
||||
case DOUBLE_QUOTE:
|
||||
case SINGLE_QUOTE:
|
||||
m_string_quote = ch;
|
||||
m_parse_state = parse_state::STRING_CONSTANT;
|
||||
break;
|
||||
case HYPHEN_MINUS:
|
||||
if (m_escape)
|
||||
{
|
||||
m_comment_start = true;
|
||||
m_parse_state = parse_state::SHORT_COMMENT;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (0 <= m_long_bracket_level)
|
||||
{
|
||||
switch (ch)
|
||||
{
|
||||
case EQUALS:
|
||||
++m_long_bracket_level;
|
||||
break;
|
||||
case LEFT_BRACKET:
|
||||
m_block_line = m_input_line;
|
||||
m_block_level = m_long_bracket_level;
|
||||
m_parse_state = parse_state::LONG_STRING_CONSTANT;
|
||||
default:
|
||||
m_long_bracket_level = -1;
|
||||
}
|
||||
}
|
||||
else if (LEFT_BRACKET == ch)
|
||||
{
|
||||
m_long_bracket_level = 0;
|
||||
}
|
||||
m_escape = (HYPHEN_MINUS == ch) && !m_escape;
|
||||
output_character(ch);
|
||||
}
|
||||
|
||||
|
||||
void lua_cleaner::process_short_comment(unicode_char ch)
|
||||
{
|
||||
if (0 <= m_long_bracket_level)
|
||||
{
|
||||
switch (ch)
|
||||
{
|
||||
case EQUALS:
|
||||
++m_long_bracket_level;
|
||||
break;
|
||||
case LEFT_BRACKET:
|
||||
m_block_line = m_input_line;
|
||||
m_block_level = m_long_bracket_level;
|
||||
m_parse_state = parse_state::LONG_COMMENT;
|
||||
set_tab_limit();
|
||||
default:
|
||||
m_long_bracket_level = -1;
|
||||
}
|
||||
}
|
||||
else if (m_comment_start && (LEFT_BRACKET == ch))
|
||||
{
|
||||
m_long_bracket_level = 0;
|
||||
}
|
||||
else if (LINE_FEED == ch)
|
||||
{
|
||||
m_parse_state = parse_state::DEFAULT;
|
||||
}
|
||||
m_comment_start = false;
|
||||
output_character(ch);
|
||||
}
|
||||
|
||||
|
||||
void lua_cleaner::process_long_comment(unicode_char ch)
|
||||
{
|
||||
if (0 <= m_long_bracket_level)
|
||||
{
|
||||
switch (ch)
|
||||
{
|
||||
case EQUALS:
|
||||
++m_long_bracket_level;
|
||||
break;
|
||||
case RIGHT_BRACKET:
|
||||
if (m_long_bracket_level == m_block_level)
|
||||
{
|
||||
m_parse_state = parse_state::DEFAULT;
|
||||
reset_tab_limit();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_long_bracket_level = 0;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
m_long_bracket_level = -1;
|
||||
}
|
||||
}
|
||||
else if (RIGHT_BRACKET == ch)
|
||||
{
|
||||
m_long_bracket_level = 0;
|
||||
}
|
||||
output_character(ch);
|
||||
}
|
||||
|
||||
|
||||
void lua_cleaner::process_string_constant(unicode_char ch)
|
||||
{
|
||||
switch (ch)
|
||||
{
|
||||
case HORIZONTAL_TAB:
|
||||
++m_tabs_escaped;
|
||||
if (!m_escape)
|
||||
output_character(BACKSLASH);
|
||||
output_character(unicode_char(std::uint8_t('t')));
|
||||
break;
|
||||
case LINE_FEED:
|
||||
if (m_escape)
|
||||
{
|
||||
++m_newlines_escaped;
|
||||
output_character(unicode_char(std::uint8_t('n')));
|
||||
}
|
||||
else
|
||||
{
|
||||
throw std::runtime_error(util::string_format("unterminated string literal on line %1$u", m_input_line));
|
||||
}
|
||||
break;
|
||||
case VERTICAL_TAB:
|
||||
++m_tabs_escaped;
|
||||
if (!m_escape)
|
||||
output_character(BACKSLASH);
|
||||
output_character(unicode_char(std::uint8_t('v')));
|
||||
break;
|
||||
default:
|
||||
output_character(ch);
|
||||
if (!m_escape && (m_string_quote == ch))
|
||||
m_parse_state = parse_state::DEFAULT;
|
||||
}
|
||||
m_escape = (BACKSLASH == ch) && !m_escape;
|
||||
}
|
||||
|
||||
|
||||
void lua_cleaner::process_long_string_constant(unicode_char ch)
|
||||
{
|
||||
// this works because they're both closed by a matching long bracket
|
||||
process_long_comment(ch);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
XML DATA CLEANER CLASS
|
||||
***************************************************************************/
|
||||
@ -1310,10 +1652,9 @@ public:
|
||||
xml_cleaner(OutputIt &&output, newline newline_mode, unsigned tab_width);
|
||||
|
||||
private:
|
||||
constexpr static unicode_char EXCLAMATION = 0x0000'0021U;
|
||||
constexpr static unicode_char HYPHEN = 0x0000'002dU;
|
||||
constexpr static unicode_char LEFT_ANGLE_BRACKET = 0x0000'003cU;
|
||||
constexpr static unicode_char RIGHT_ANGLE_BRACKET = 0x0000'003eU;
|
||||
static constexpr unicode_char EXCLAMATION = 0x0000'0021U;
|
||||
static constexpr unicode_char LEFT_ANGLE_BRACKET = 0x0000'003cU;
|
||||
static constexpr unicode_char RIGHT_ANGLE_BRACKET = 0x0000'003eU;
|
||||
|
||||
enum class parse_state
|
||||
{
|
||||
@ -1390,7 +1731,7 @@ void xml_cleaner::process_default(unicode_char ch)
|
||||
break;
|
||||
case 2U:
|
||||
case 3U:
|
||||
m_escape = (HYPHEN == ch) ? (m_escape + 1U) : 0U;
|
||||
m_escape = (HYPHEN_MINUS == ch) ? (m_escape + 1U) : 0U;
|
||||
break;
|
||||
}
|
||||
output_character(ch);
|
||||
@ -1413,10 +1754,10 @@ void xml_cleaner::process_comment(unicode_char ch)
|
||||
{
|
||||
case 0U:
|
||||
case 1U:
|
||||
m_escape = (HYPHEN == ch) ? (m_escape + 1U) : 0U;
|
||||
m_escape = (HYPHEN_MINUS == ch) ? (m_escape + 1U) : 0U;
|
||||
break;
|
||||
case 2U:
|
||||
m_escape = (RIGHT_ANGLE_BRACKET == ch) ? (m_escape + 1U) : (HYPHEN == ch) ? m_escape : 0U;
|
||||
m_escape = (RIGHT_ANGLE_BRACKET == ch) ? (m_escape + 1U) : (HYPHEN_MINUS == ch) ? m_escape : 0U;
|
||||
break;
|
||||
}
|
||||
output_character(ch);
|
||||
@ -1451,6 +1792,13 @@ bool is_c_source_extension(char const *ext)
|
||||
}
|
||||
|
||||
|
||||
bool is_lua_source_extension(char const *ext)
|
||||
{
|
||||
return
|
||||
!core_stricmp(ext, ".lua");
|
||||
}
|
||||
|
||||
|
||||
bool is_xml_extension(char const *ext)
|
||||
{
|
||||
return
|
||||
@ -1528,10 +1876,13 @@ int main(int argc, char *argv[])
|
||||
// instantiate appropriate cleaner implementation
|
||||
char const *const ext(std::strrchr(argv[1], '.'));
|
||||
bool const is_c_file(ext && is_c_source_extension(ext));
|
||||
bool const is_lua_file(ext && is_lua_source_extension(ext));
|
||||
bool const is_xml_file(ext && is_xml_extension(ext));
|
||||
std::unique_ptr<cleaner_base> cleaner;
|
||||
if (is_c_file)
|
||||
cleaner = std::make_unique<cpp_cleaner>(std::back_inserter(output), newline_mode, 4U);
|
||||
else if (is_lua_file)
|
||||
cleaner = std::make_unique<lua_cleaner>(std::back_inserter(output), newline_mode, 4U);
|
||||
else if (is_xml_file)
|
||||
cleaner = std::make_unique<xml_cleaner>(std::back_inserter(output), newline_mode, 4U);
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user