From 7167ce41b61d2ba2cdb526777a4233eb84a3b66a Mon Sep 17 00:00:00 2001 From: Unit 193 Date: Sat, 6 Dec 2014 17:33:25 -0500 Subject: Imported Upstream version 2.99.6 --- Plugins/SqlEnterpriseFormatter/formatpragma.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Plugins/SqlEnterpriseFormatter/formatpragma.cpp (limited to 'Plugins/SqlEnterpriseFormatter/formatpragma.cpp') diff --git a/Plugins/SqlEnterpriseFormatter/formatpragma.cpp b/Plugins/SqlEnterpriseFormatter/formatpragma.cpp new file mode 100644 index 0000000..0b6491a --- /dev/null +++ b/Plugins/SqlEnterpriseFormatter/formatpragma.cpp @@ -0,0 +1,24 @@ +#include "formatpragma.h" +#include "parser/ast/sqlitepragma.h" + +FormatPragma::FormatPragma(SqlitePragma* pragma) : + pragma(pragma) +{ +} + +void FormatPragma::formatInternal() +{ + withKeyword("PRAGMA"); + + if (!pragma->database.isNull()) + withId(pragma->database).withIdDot(); + + withId(pragma->pragmaName); + + if (pragma->equalsOp) + withOperator("=").withLiteral(pragma->value); + else if (pragma->parenthesis) + withParExprLeft().withLiteral(pragma->value).withParExprRight(); + + withSemicolon(); +} -- cgit v1.2.3