@dbml/core
Advanced tools
Comparing version 3.5.1 to 3.5.2-alpha.0
@@ -14,2 +14,5 @@ "use strict"; | ||
var _MySQLASTGen = _interopRequireDefault(require("./mysql/MySQLASTGen")); | ||
var _SnowflakeLexer = _interopRequireDefault(require("../parsers/snowflake/SnowflakeLexer")); | ||
var _SnowflakeParser = _interopRequireDefault(require("../parsers/snowflake/SnowflakeParser")); | ||
var _SnowflakeASTGen = _interopRequireDefault(require("./snowflake/SnowflakeASTGen")); | ||
var _ParserErrorListener = _interopRequireDefault(require("./ParserErrorListener")); | ||
@@ -51,2 +54,15 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
} | ||
case 'snowflake': | ||
{ | ||
var _lexer2 = new _SnowflakeLexer["default"](chars); | ||
var _tokens2 = new _antlr["default"].CommonTokenStream(_lexer2); | ||
var _parser2 = new _SnowflakeParser["default"](_tokens2); | ||
_parser2.buildParseTrees = true; | ||
_parser2.removeErrorListeners(); | ||
_parser2.addErrorListener(errorListener); | ||
var _parseTree2 = _parser2.snowflake_file(); | ||
database = _parseTree2.accept(new _SnowflakeASTGen["default"]()); | ||
if (errorListener.errors.length) throw errorListener.errors; | ||
break; | ||
} | ||
default: | ||
@@ -53,0 +69,0 @@ throw new Error("Format not supported: ".concat(format)); |
@@ -43,2 +43,5 @@ "use strict"; | ||
break; | ||
case 'snowflake': | ||
rawDatabase = Parser.parseSnowflakeToJSON(str); | ||
break; | ||
case 'postgresLegacy': | ||
@@ -137,2 +140,7 @@ rawDatabase = Parser.parsePostgresToJSON(str); | ||
}, { | ||
key: "parseSnowflakeToJSON", | ||
value: function parseSnowflakeToJSON(str) { | ||
return (0, _ASTGeneration.parse)(str, 'snowflake'); | ||
} | ||
}, { | ||
key: "parse", | ||
@@ -139,0 +147,0 @@ value: function parse(str, format) { |
{ | ||
"name": "@dbml/core", | ||
"version": "3.5.1", | ||
"version": "3.5.2-alpha.0", | ||
"description": "> TODO: description", | ||
@@ -35,3 +35,3 @@ "author": "Holistics <dev@holistics.io>", | ||
"dependencies": { | ||
"@dbml/parse": "^3.5.1", | ||
"@dbml/parse": "^3.5.2-alpha.0", | ||
"antlr4": "^4.13.1", | ||
@@ -63,3 +63,3 @@ "lodash": "^4.17.15", | ||
}, | ||
"gitHead": "46a1e6974db093e52d2ba80a26d1865d3bb4c58a" | ||
"gitHead": "f37f2c214e7f5d73905db67707743de858c488a6" | ||
} |
@@ -16,2 +16,3 @@ export declare type WarningLevel = | ||
readonly filepath?: Readonly<string>; | ||
readonly stack?: Readonly<unknown>; | ||
readonly location: { | ||
@@ -18,0 +19,0 @@ start: Readonly<EditorPosition>, |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
13705594
150
48965
2
Updated@dbml/parse@^3.5.2-alpha.0