Sha256: a2385e59c469fd91a4b04ef1e6ba77f175ea63214e01df45d2d6879a624a495c

Contents?: true

Size: 1.04 KB

Versions: 5

Compression:

Stored size: 1.04 KB

Contents

//
//  ConversionContext.cc
//  drafter
//
//  Created by Pavan Kumar Sunkara on 18/08/16.
//  Copyright © 2016 Apiary. All rights reserved.
//

#include "ConversionContext.h"

namespace drafter {

    void ConversionContext::warn(const snowcrash::Warning& warning)
    {
        for (auto& item : warnings) {
            bool equalSourceMap = true;

            // Compare sourcemap
            if (item.location.size() == warning.location.size()) {
                for (size_t i = 0; i < item.location.size(); i++) {
                    if (item.location.at(i).length != warning.location.at(i).length ||
                        item.location.at(i).location != warning.location.at(i).location) {

                        equalSourceMap = false;
                    }
                }
            }
            else {
                equalSourceMap = false;
            }

            if (equalSourceMap && item.code == warning.code && item.message == warning.message) {
                return;
            }
        }

        warnings.push_back(warning);
    }
}

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
lounge_lizard-0.1.4 ext/drafter/src/ConversionContext.cc
lounge_lizard-0.1.3 ext/drafter/src/ConversionContext.cc
lounge_lizard-0.1.2 ext/drafter/src/ConversionContext.cc
lounge_lizard-0.1.1 ext/drafter/src/ConversionContext.cc
lounge_lizard-0.1.0 ext/drafter/src/ConversionContext.cc