Skip to content
Browse files

Rename DEBUG macro to LEG_DEBUG in leg utility

When DEBUG is defined, leg stops with a non-zero exit code after debug output
which breaks the build. So rename the macro to not get leg's debug code
activated by the common DEBUG macro but still keep the functionality with
LEG_DEBUG.
  • Loading branch information...
1 parent 75d06fd commit eba24600223cb91ae28ee4caaa00bc4891a74ae9 @eht16 eht16 committed Mar 10, 2013
Showing with 7 additions and 7 deletions.
  1. +7 −7 markdown/peg-markdown/peg-0.1.9/tree.c
View
14 markdown/peg-markdown/peg-0.1.9/tree.c
@@ -1,6 +1,6 @@
/* Copyright (c) 2007 by Ian Piumarta
* All rights reserved.
- *
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the 'Software'),
* to deal in the Software without restriction, including without limitation
@@ -10,9 +10,9 @@
* permission notice appear in all copies of the Software. Acknowledgement
* of the use of this Software in supporting documentation would be
* appreciated but is not required.
- *
+ *
* THE SOFTWARE IS PROVIDED 'AS IS'. USE ENTIRELY AT YOUR OWN RISK.
- *
+ *
* Last edited: 2007-05-15 10:32:09 by piumarta on emilia
*/
@@ -77,7 +77,7 @@ Node *beginRule(Node *rule)
void Rule_setExpression(Node *node, Node *expression)
{
assert(node);
-#ifdef DEBUG
+#ifdef LEG_DEBUG
Node_print(node); fprintf(stderr, " [%d]<- ", node->type); Node_print(expression); fprintf(stderr, "\n");
#endif
assert(Rule == node->type);
@@ -252,7 +252,7 @@ static Node *stack[1024];
static Node **stackPointer= stack;
-#ifdef DEBUG
+#ifdef LEG_DEBUG
static void dumpStack(void)
{
Node **p;
@@ -269,7 +269,7 @@ Node *push(Node *node)
{
assert(node);
assert(stackPointer < stack + 1023);
-#ifdef DEBUG
+#ifdef LEG_DEBUG
dumpStack(); fprintf(stderr, " PUSH "); Node_print(node); fprintf(stderr, "\n");
#endif
return *++stackPointer= node;
@@ -284,7 +284,7 @@ Node *top(void)
Node *pop(void)
{
assert(stackPointer > stack);
-#ifdef DEBUG
+#ifdef LEG_DEBUG
dumpStack(); fprintf(stderr, " POP\n");
#endif
return *stackPointer--;

0 comments on commit eba2460

Please sign in to comment.
Something went wrong with that request. Please try again.