shithub: rgbds

Download patch

ref: 71d8aeb4c276d29764bf0f76879a2b6047c85803
parent: 0836f67d429d2f545f43e203023d174ca4442779
author: ISSOtm <eldredhabert0@gmail.com>
date: Mon Oct 12 05:02:21 EDT 2020

Add CMake defines to enable tracing lexer and parser

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -27,6 +27,8 @@
 
 option(SANITIZERS "Build with sanitizers enabled" OFF)
 option(MORE_WARNINGS "Turn on more warnings" OFF)
+option(TRACE_PARSER "Trace parser execution" OFF)
+option(TRACE_LEXER "Trace lexer execution" OFF)
 
 if(MSVC)
   add_compile_options(/W1 /MP)
@@ -69,3 +71,11 @@
 set(CMAKE_C_STANDARD_REQUIRED True)
 
 add_subdirectory(src)
+
+if(TRACE_PARSER)
+  target_compile_definitions(rgbasm PRIVATE -DYYDEBUG)
+endif()
+
+if(TRACE_LEXER)
+  target_compile_definitions(rgbasm PRIVATE -DLEXER_DEBUG)
+endif()