Current Version: 1.0.20
Project Name: csspp
Namespaces | Functions | Variables
error.cpp File Reference

Implementation of the CSS Preprocessor error handling. More...

#include "csspp/error.h"
#include <cmath>
#include <iostream>
Include dependency graph for error.cpp:

Go to the source code of this file.


 The namespace of all the classes in the CSS Preprocessor.


std::ostream & operator<< (std::ostream &out, csspp::error_mode_t const type)


error * csspp::anonymous_namespace{error.cpp}::g_error = nullptr

Detailed Description

The library handles errors by printing messages to a standard output stream. The functions also count the number of errors and warnings that occur while parsing and compiling a source file.

The output can be redirected to your own buffer.

The number of errors can be protected by an RAII class so the exact same instance of the library can be reused any number of times (in case you were to create a GUI that helps debug code quickly, possibly inline...)

// error counts are zero
csspp::safe_error_t safe_errors;
// super over simplified... (no proper error handling
// and probably a bit wrong)
csspp::lexer l(input, pos);
csspp::node root(p.stylesheet());
// get number of errors before the '}'
// error counts are still zero, they were restored by safe_error_t
See also
Lexer Rules

Definition in file error.cpp.

Function Documentation

std::ostream& operator<< ( std::ostream &  out,
csspp::error_mode_t const  type 

Documentation of CSS Preprocessor.

This document is part of the Snap! Websites Project.

Copyright by Made to Order Software Corp.