Current Version: 1.0.33
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

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

Functions

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

Variables

errorcsspp::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
void set_root(node::pointer_t root)
Definition compiler.cpp:419
void compile(bool bare)
Definition compiler.cpp:528
error_count_t get_error_count() const
Definition error.cpp:105
uint32_t error_count_t
Definition error.h:43
See also
Lexer Rules

Definition in file error.cpp.

Function Documentation

◆ operator<<()

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.