Renamed viz -> printing, and tidied up the code a bit
This commit is contained in:
parent
668c7baf55
commit
03c790d5b6
2
Makefile
2
Makefile
@ -7,7 +7,7 @@ CWARN=-Wall -Wpedantic -Wextra -Wsign-conversion -Wtype-limits -Wunused-result
|
||||
G=
|
||||
O=-O3
|
||||
|
||||
CFILES=compiler.c grammar.c utils.c vm.c file_loader.c viz.c json.c
|
||||
CFILES=compiler.c grammar.c utils.c vm.c file_loader.c printing.c json.c
|
||||
OBJFILES=$(CFILES:.c=.o)
|
||||
|
||||
all: $(NAME)
|
||||
|
2
bp.c
2
bp.c
@ -15,8 +15,8 @@
|
||||
#include "file_loader.h"
|
||||
#include "grammar.h"
|
||||
#include "json.h"
|
||||
#include "printing.h"
|
||||
#include "utils.h"
|
||||
#include "viz.h"
|
||||
#include "vm.h"
|
||||
|
||||
static const char *usage = (
|
||||
|
@ -1,16 +1,21 @@
|
||||
/*
|
||||
* viz.c - Visualize matches.
|
||||
* printing.c - Code for printing and visualizing matches.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "printing.h"
|
||||
#include "types.h"
|
||||
#include "utils.h"
|
||||
#include "viz.h"
|
||||
#include "vm.h"
|
||||
|
||||
typedef struct match_node_s {
|
||||
match_t *m;
|
||||
struct match_node_s *next;
|
||||
} match_node_t;
|
||||
|
||||
typedef struct {
|
||||
size_t line, printed_line;
|
||||
const char *color;
|
@ -1,13 +1,15 @@
|
||||
/*
|
||||
* Header file for viz.c (visualizing matches)
|
||||
* Header file for printing.c (printing/visualizing matches)
|
||||
*/
|
||||
#ifndef VIZ__H
|
||||
#define VIZ__H
|
||||
#ifndef PRINTING__H
|
||||
#define PRINTING__H
|
||||
|
||||
typedef struct match_node_s {
|
||||
match_t *m;
|
||||
struct match_node_s *next;
|
||||
} match_node_t;
|
||||
#include "types.h"
|
||||
|
||||
typedef enum {
|
||||
PRINT_COLOR = 1<<0,
|
||||
PRINT_LINE_NUMBERS = 1<<1,
|
||||
} print_options_t;
|
||||
|
||||
__attribute__((nonnull))
|
||||
void visualize_match(match_t *m);
|
Loading…
Reference in New Issue
Block a user