Compare commits
No commits in common. "master" and "v0.0.15" have entirely different histories.
|
@ -1,6 +1,6 @@
|
||||||
[metadata]
|
[metadata]
|
||||||
name = ProcruSQL
|
name = ProcruSQL
|
||||||
version = 0.0.16
|
version = 0.0.15
|
||||||
author = Peter J. Holzer
|
author = Peter J. Holzer
|
||||||
author_email = hjp@hjp.at
|
author_email = hjp@hjp.at
|
||||||
description = Make a database fit its description
|
description = Make a database fit its description
|
||||||
|
@ -9,7 +9,6 @@ long_description_content_type = text/markdown
|
||||||
url = https://git.hjp.at:3000/hjp/procrusql
|
url = https://git.hjp.at:3000/hjp/procrusql
|
||||||
project_urls =
|
project_urls =
|
||||||
Bug Tracker = https://git.hjp.at:3000/hjp/procrusql/issues
|
Bug Tracker = https://git.hjp.at:3000/hjp/procrusql/issues
|
||||||
Repository = https://git.hjp.at:3000/hjp/procrusql
|
|
||||||
classifiers =
|
classifiers =
|
||||||
Programming Language :: Python :: 3
|
Programming Language :: Python :: 3
|
||||||
License :: OSI Approved :: MIT License
|
License :: OSI Approved :: MIT License
|
||||||
|
|
|
@ -43,7 +43,7 @@ class ParseState:
|
||||||
linesbefore = self.text[:position].split("\n")
|
linesbefore = self.text[:position].split("\n")
|
||||||
linesafter = self.text[position:].split("\n")
|
linesafter = self.text[position:].split("\n")
|
||||||
good = "\x1B[40;32m"
|
good = "\x1B[40;32m"
|
||||||
bad = "\x1B[40;31;1m"
|
bad = "\x1B[40;31m"
|
||||||
reset = "\x1B[0m"
|
reset = "\x1B[0m"
|
||||||
s = reset + message + "\n"
|
s = reset + message + "\n"
|
||||||
lines = []
|
lines = []
|
||||||
|
@ -79,8 +79,7 @@ def parse_ruleset(ps):
|
||||||
ps3 = parse_table_rule(ps2) or \
|
ps3 = parse_table_rule(ps2) or \
|
||||||
parse_column_rule(ps2) or \
|
parse_column_rule(ps2) or \
|
||||||
parse_data_rule(ps2) or \
|
parse_data_rule(ps2) or \
|
||||||
parse_index_rule(ps2) or \
|
parse_index_rule(ps2)
|
||||||
parse_view_rule(ps2)
|
|
||||||
if ps3:
|
if ps3:
|
||||||
ps2.ast.append(ps3.ast)
|
ps2.ast.append(ps3.ast)
|
||||||
ps2.position = ps3.position
|
ps2.position = ps3.position
|
||||||
|
@ -274,20 +273,6 @@ def parse_index_rule(ps):
|
||||||
|
|
||||||
return ps2
|
return ps2
|
||||||
|
|
||||||
def parse_view_rule(ps):
|
|
||||||
ps2 = ps.clone()
|
|
||||||
ps2.skip_whitespace_and_comments()
|
|
||||||
if not ps2.match(r"view\b"):
|
|
||||||
ps.record_child_failure(ps2, "expected “view”")
|
|
||||||
return
|
|
||||||
ps2.skip_whitespace_and_comments()
|
|
||||||
ps3 = parse_table_name(ps2)
|
|
||||||
if not ps3:
|
|
||||||
ps.record_child_failure(ps2, "expected view name")
|
|
||||||
return
|
|
||||||
ps2.skip_whitespace_and_comments()
|
|
||||||
ps3 = parse_multiline_string(ps2)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def parse_table_name(ps):
|
def parse_table_name(ps):
|
||||||
|
@ -355,7 +340,6 @@ def parse_column_definition(ps):
|
||||||
"json", "jsonb",
|
"json", "jsonb",
|
||||||
"uuid",
|
"uuid",
|
||||||
r"integer\[\]", r"int\[\]", r"bigint\[\]",
|
r"integer\[\]", r"int\[\]", r"bigint\[\]",
|
||||||
"bytea",
|
|
||||||
),
|
),
|
||||||
key=lambda x: -len(x) # longest match first
|
key=lambda x: -len(x) # longest match first
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue