1.1 --- a/src/CompileContext.cpp Mon Sep 17 00:10:01 2012 -0700
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,58 +0,0 @@
1.4 -/*
1.5 - * Copyright (C) 2012 David Anderson
1.6 - *
1.7 - * This file is part of JITCraft.
1.8 - *
1.9 - * JITCraft is free software: you can redistribute it and/or modify it under
1.10 - * the terms of the GNU General Public License as published by the Free
1.11 - * Software Foundation, either version 3 of the License, or (at your option)
1.12 - * any later version.
1.13 - *
1.14 - * Foobar is distributed in the hope that it will be useful, but WITHOUT ANY
1.15 - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
1.16 - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
1.17 - *
1.18 - * You should have received a copy of the GNU General Public License along with
1.19 - * JITCraft. If not, see http://www.gnu.org/licenses/.
1.20 - */
1.21 -#include <stdio.h>
1.22 -#include "Scanner.h"
1.23 -#include "CompileContext.h"
1.24 -#include "Zone.h"
1.25 -#include "Spaces-inl.h"
1.26 -#include "Heap-inl.h"
1.27 -
1.28 -using namespace ke;
1.29 -
1.30 -CompileContext::CompileContext(Zone *zone, const char *file)
1.31 - : zone_(zone),
1.32 - failures_(0),
1.33 - file_(file)
1.34 -{
1.35 -}
1.36 -
1.37 -CompileContext::~CompileContext()
1.38 -{
1.39 - if (failures_)
1.40 - zone_->endCompilationErrors();
1.41 -}
1.42 -
1.43 -void
1.44 -CompileContext::reportErrorVa(const SourcePosition &pos, Message msg, va_list ap)
1.45 -{
1.46 - if (!failures_)
1.47 - zone_->beginCompilationErrors(file_);
1.48 -
1.49 - zone_->reportCompilationError(msg, pos.line, pos.col, ap);
1.50 -
1.51 - failures_++;
1.52 -}
1.53 -
1.54 -void
1.55 -CompileContext::reportError(const SourcePosition &pos, Message msg, ...)
1.56 -{
1.57 - va_list ap;
1.58 - va_start(ap, msg);
1.59 - reportErrorVa(pos, msg, ap);
1.60 - va_end(ap);
1.61 -}