[code] Add parentheses after function names in Var.

Change-Id: I7e3e993d07139c40c6bd59fd5879b3ee091f5127
This commit is contained in:
Léa Saviot
2017-11-30 16:57:47 +01:00
parent 9805f7570e
commit 62fe441b7a
10 changed files with 169 additions and 121 deletions

35
apps/code/script_node.h Normal file
View File

@@ -0,0 +1,35 @@
#ifndef CODE_SCRIPT_NODE_H
#define CODE_SCRIPT_NODE_H
#include <stdint.h>
namespace Code {
class ScriptNode {
public:
enum class Type {
Function = 0,
Variable = 1
};
ScriptNode() :
m_type(Type::Function), m_name(nullptr), m_scriptIndex(0) {}
static ScriptNode FunctionNode(const char * name, uint16_t scriptIndex) {
return ScriptNode(Type::Function, name, scriptIndex);
}
static ScriptNode VariableNode(const char * name, uint16_t scriptIndex) {
return ScriptNode(Type::Variable, name, scriptIndex);
}
Type type() const { return m_type; }
const char * name() const { return m_name; }
uint16_t scriptIndex() const { return m_scriptIndex; }
private:
ScriptNode(Type type, const char * name, uint16_t scriptIndex) :
m_type(type), m_name(name), m_scriptIndex(scriptIndex) {}
Type m_type;
const char * m_name;
uint16_t m_scriptIndex;
};
}
#endif