Add view definitions
This commit is contained in:
parent
f6c64a50ab
commit
d31204cd5c
|
@ -78,7 +78,8 @@ 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)
|
parse_index_rule(ps2) or \
|
||||||
|
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
|
||||||
|
@ -236,6 +237,20 @@ 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):
|
||||||
|
|
Loading…
Reference in New Issue