Skip to content

Commit

Permalink
Update upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Dec 17, 2016
1 parent b9eedf5 commit 96ced50
Show file tree
Hide file tree
Showing 14 changed files with 632 additions and 574 deletions.
2 changes: 1 addition & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
.*\.so
.*\.a
.*\.dll

src/empty.dll$
^\.travis\.yml$
^appveyor\.yml$
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: graphql
Type: Package
Title: A GraphQL Query Parser
Version: 1.0
Version: 1.1
Authors@R: c(
person("Jeroen", "Ooms", , "[email protected]", role = c("cre", "aut")),
person("Scott", "Wolchok", role = "ctb"),
Expand Down
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
1.1
- Update libgraphqlparser from graphql/libgraphqlparser@32680f6
7 changes: 7 additions & 0 deletions src/libgraphqlparser/Ast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,13 @@ void BooleanValue::accept(visitor::AstVisitor *visitor) {
visitor->endVisitBooleanValue(*this);
}

void NullValue::accept(visitor::AstVisitor *visitor) {
if (visitor->visitNullValue(*this)) {

}
visitor->endVisitNullValue(*this);
}

void EnumValue::accept(visitor::AstVisitor *visitor) {
if (visitor->visitEnumValue(*this)) {

Expand Down
20 changes: 20 additions & 0 deletions src/libgraphqlparser/Ast.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class IntValue;
class FloatValue;
class StringValue;
class BooleanValue;
class NullValue;
class EnumValue;
class ListValue;
class ObjectValue;
Expand Down Expand Up @@ -511,6 +512,25 @@ class BooleanValue : public Value {
};


class NullValue : public Value {
public:
explicit NullValue(
const yy::location &location

)
: Value(location)

{}

~NullValue() {}

NullValue(const NullValue&) = delete;
NullValue& operator=(const NullValue&) = delete;

void accept(visitor::AstVisitor *visitor) override;
};


class EnumValue : public Value {
std::unique_ptr<const char, CDeleter> value_;
public:
Expand Down
3 changes: 3 additions & 0 deletions src/libgraphqlparser/AstVisitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ class AstVisitor {
virtual bool visitBooleanValue(const BooleanValue &booleanValue) { return true; }
virtual void endVisitBooleanValue(const BooleanValue &booleanValue) { }

virtual bool visitNullValue(const NullValue &nullValue) { return true; }
virtual void endVisitNullValue(const NullValue &nullValue) { }

virtual bool visitEnumValue(const EnumValue &enumValue) { return true; }
virtual void endVisitEnumValue(const EnumValue &enumValue) { }

Expand Down
6 changes: 6 additions & 0 deletions src/libgraphqlparser/JsonVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,12 @@ void JsonVisitor::endVisitEnumValue(const EnumValue &enumValue) {
endVisitValueRepresentedAsString("EnumValue", enumValue);
}

void JsonVisitor::endVisitNullValue(const NullValue &nullValue) {
startPrintingNode("NullValue", nullValue.getLocation());
out_ << '}';
printed_.back().emplace_back(out_.str());
}

void JsonVisitor::endVisitBooleanValue(const BooleanValue &booleanValue) {
startPrintingNode("BooleanValue", booleanValue.getLocation());

Expand Down
2 changes: 2 additions & 0 deletions src/libgraphqlparser/JsonVisitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ class JsonVisitor : public AstVisitor {

void endVisitBooleanValue(const BooleanValue &booleanValue) override;

void endVisitNullValue(const NullValue &nullValue) override;

void endVisitEnumValue(const EnumValue &enumValue) override;

bool visitListValue(const ListValue &arrayValue) override;
Expand Down
2 changes: 2 additions & 0 deletions src/libgraphqlparser/c/GraphQLAst.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ const char * GraphQLAstStringValue_get_value(const struct GraphQLAstStringValue
struct GraphQLAstBooleanValue;
int GraphQLAstBooleanValue_get_value(const struct GraphQLAstBooleanValue *node);

struct GraphQLAstNullValue;

struct GraphQLAstEnumValue;
const char * GraphQLAstEnumValue_get_value(const struct GraphQLAstEnumValue *node);

Expand Down
1 change: 1 addition & 0 deletions src/libgraphqlparser/c/GraphQLAstForEachConcreteType.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ MACRO(IntValue, int_value) \
MACRO(FloatValue, float_value) \
MACRO(StringValue, string_value) \
MACRO(BooleanValue, boolean_value) \
MACRO(NullValue, null_value) \
MACRO(EnumValue, enum_value) \
MACRO(ListValue, list_value) \
MACRO(ObjectValue, object_value) \
Expand Down
2 changes: 1 addition & 1 deletion src/libgraphqlparser/lexer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,7 @@ YY_RULE_SETUP
#line 87 "lexer.lpp"
{
int ch;
sscanf(yytext + 1, "%x", &ch);
sscanf(yytext + 2, "%x", &ch);
yyextra->str.push_back(ch);
}
YY_BREAK
Expand Down
2 changes: 1 addition & 1 deletion src/libgraphqlparser/lexer.lpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ notnewline [^\n\r]

\\u[0-9A-Fa-f]{4} {
int ch;
sscanf(yytext + 1, "%x", &ch);
sscanf(yytext + 2, "%x", &ch);
yyextra->str.push_back(ch);
}

Expand Down
Loading

0 comments on commit 96ced50

Please sign in to comment.