1.1 --- a/jitcraft/AST.h Sun Jul 01 11:25:36 2012 -0700
1.2 +++ b/jitcraft/AST.h Sun Jul 01 14:52:57 2012 -0700
1.3 @@ -31,6 +31,7 @@
1.4 _(ReturnStatement) \
1.5 _(IntegerLiteral) \
1.6 _(FloatLiteral) \
1.7 + _(StringLiteral) \
1.8 _(BinaryExpression) \
1.9 _(BlockStatement) \
1.10 _(Assignment) \
1.11 @@ -273,6 +274,27 @@
1.12 }
1.13 };
1.14
1.15 +class StringLiteral : public Expression
1.16 +{
1.17 + ByteArray *string_;
1.18 +
1.19 + public:
1.20 + StringLiteral(ByteArray *array)
1.21 + : string_(array)
1.22 + {
1.23 + }
1.24 +
1.25 + Kind kind() const {
1.26 + return kStringLiteral;
1.27 + }
1.28 + ByteArray *string() const {
1.29 + return string_;
1.30 + }
1.31 + void accept(AstVisitor *visitor) {
1.32 + visitor->visit(this);
1.33 + }
1.34 +};
1.35 +
1.36 class BinaryExpression : public Expression
1.37 {
1.38 Expression *left_;