aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sksl/ast/SkSLASTIntLiteral.h
blob: f524bc04adb88dfc989fbf3d067de9a1e5e80800 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
 * Copyright 2016 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */
 
#ifndef SKSL_ASTINTLITERAL
#define SKSL_ASTINTLITERAL

#include "SkSLASTExpression.h"

namespace SkSL {

/**
 * A literal integer. At the AST level, integer literals are always positive; a negative number will
 * appear as a unary minus being applied to an integer literal.
 */
struct ASTIntLiteral : public ASTExpression {
    ASTIntLiteral(Position position, uint64_t value)
    : INHERITED(position, kInt_Kind)
    , fValue(value) {}

    SkString description() const override {
        return to_string(fValue);
    }

    const uint64_t fValue;

    typedef ASTExpression INHERITED;
};

} // namespace

#endif