dmut
Advanced tools
Comparing version 0.5.6 to 0.5.7
#!/usr/bin/node --enable-source-maps | ||
import { Parseur, Context, Rule, Token } from 'parseur'; | ||
export declare class DmutContext extends Context { | ||
current_marker?: string; | ||
current_marker: string[]; | ||
} | ||
@@ -6,0 +6,0 @@ export declare class DmutParser extends Parseur<DmutContext> { |
@@ -15,2 +15,6 @@ #!/usr/bin/node --enable-source-maps | ||
class DmutContext extends parseur_1.Context { | ||
constructor() { | ||
super(...arguments); | ||
this.current_marker = []; | ||
} | ||
} | ||
@@ -30,3 +34,3 @@ exports.DmutContext = DmutContext; | ||
this.leftovers = [ | ||
'::', ':', '(', ')', '[', ']', '{', '}', '|', '=', '#', '?', '!', '~', '-', '>', '<', '+', '*', '/', '|', '%', | ||
'::', ':', '(', ')', '[', ']', '{', '}', '|', '=', '#', '?', '!', '~', '-', '>', '<', '+', '*', '/', '|', '%', '^' | ||
].map(t => this.token(t)); | ||
@@ -37,3 +41,3 @@ this.NUM = this.token(/\d+/); | ||
this.SQLID_BASE = this.token(/"(""|[^"])*"|[@$a-zA-Z_][\w$]*|\[[^\]]+\]|`(``|[^`])*`/); | ||
this.STRING = this.token(/'(''|[^'])*'/); | ||
this.STRING = this.token(/'(\\'|''|[^'])*'/); | ||
this.WS = this.token(/(\s|--[^\n]*\n?)+/).skip(); | ||
@@ -43,5 +47,5 @@ // Id = this.ID.then(i => i.str) | ||
this.SqlidString = parseur_1.Seq(this.SqlIdBase.then((i, ctx) => { | ||
ctx.current_marker = i; | ||
ctx.current_marker.unshift(i); | ||
return i; | ||
}), parseur_1.AnyTokenUntil(this.SqlIdBase.then((i, ctx) => i !== ctx.current_marker ? parseur_1.NoMatch : i))); | ||
}), parseur_1.AnyTokenUntil(this.SqlIdBase.then((i, ctx) => i !== ctx.current_marker[0] ? parseur_1.NoMatch : (ctx.current_marker.shift(), i)))); | ||
this.SqlId = parseur_1.Seq({ | ||
@@ -48,0 +52,0 @@ id: this.SqlIdBase, |
{ | ||
"name": "dmut", | ||
"version": "0.5.6", | ||
"version": "0.5.7", | ||
"repository": "https://github.com/ceymard/dmut", | ||
@@ -5,0 +5,0 @@ "description": "A migration utility for PostgreSQL designed for schema and code changes inside your database.", |
@@ -16,3 +16,3 @@ #!/usr/bin/node --enable-source-maps | ||
export class DmutContext extends Context { | ||
current_marker?: string | ||
current_marker: string[] = [] | ||
} | ||
@@ -40,3 +40,3 @@ | ||
leftovers = [ | ||
'::', ':', '(', ')', '[', ']', '{', '}', '|', '=', '#', '?', '!', '~', '-', '>', '<', '+', '*', '/', '|', '%', | ||
'::', ':', '(', ')', '[', ']', '{', '}', '|', '=', '#', '?', '!', '~', '-', '>', '<', '+', '*', '/', '|', '%', '^' | ||
].map(t => this.token(t)) | ||
@@ -48,3 +48,3 @@ NUM = this.token(/\d+/) | ||
SQLID_BASE = this.token(/"(""|[^"])*"|[@$a-zA-Z_][\w$]*|\[[^\]]+\]|`(``|[^`])*`/) | ||
STRING = this.token(/'(''|[^'])*'/) | ||
STRING = this.token(/'(\\'|''|[^'])*'/) | ||
WS = this.token(/(\s|--[^\n]*\n?)+/).skip() | ||
@@ -58,6 +58,6 @@ | ||
this.SqlIdBase.then((i, ctx) => { | ||
ctx.current_marker = i | ||
ctx.current_marker.unshift(i) | ||
return i | ||
}), | ||
AnyTokenUntil(this.SqlIdBase.then((i, ctx) => i !== ctx.current_marker ? NoMatch : i)), | ||
AnyTokenUntil(this.SqlIdBase.then((i, ctx) => i !== ctx.current_marker[0] ? NoMatch : (ctx.current_marker.shift(), i))), | ||
) | ||
@@ -64,0 +64,0 @@ |
Sorry, the diff of this file is not supported yet
118496
1975