Current Version: 1.0.10
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.

Namespaces

 csspp
 The namespace of all the classes in the CSS Preprocessor.
 
 csspp::anonymous_namespace{error.cpp}
 

Functions

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

Variables

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());
c.set_root(root);
c.compile()
// 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.