From aadd83d715e2b348c19100411ab100cdcc0db335 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Tue, 30 Nov 2021 18:35:16 +0100 Subject: [PATCH] Use bundled metaschema copy --- git-hooks/pre-commit | 3 +++ implementations/python/preserves/schema.prb | 8 ++++++++ implementations/python/preserves/schema.py | 2 +- implementations/python/setup.py | 2 +- 4 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 implementations/python/preserves/schema.prb diff --git a/git-hooks/pre-commit b/git-hooks/pre-commit index 3888b7a..eb1ead0 100755 --- a/git-hooks/pre-commit +++ b/git-hooks/pre-commit @@ -6,6 +6,9 @@ exec 1>&2 # Ensure that various copies of schema.prs are in fact identical. cmp schema/schema.prs implementations/racket/preserves/preserves-schema/schema.prs +# Likewise schema.bin +cmp schema/schema.bin implementations/python/preserves/schema.prb + # Likewise for samples.pr cmp tests/samples.pr implementations/racket/preserves/preserves/tests/samples.pr diff --git a/implementations/python/preserves/schema.prb b/implementations/python/preserves/schema.prb new file mode 100644 index 0000000..a248064 --- /dev/null +++ b/implementations/python/preserves/schema.prb @@ -0,0 +1,8 @@ +´³schema·³version‘³ definitions·³Ref´³rec´³lit³ref„´³tupleµ´³named³module´³refµ„³ +ModulePath„„´³named³name´³atom³Symbol„„„„„³Bundle´³rec´³lit³bundle„´³tupleµ´³named³modules´³refµ„³Modules„„„„„³Schema´³rec´³lit³schema„´³tupleµ´³dict·³version´³named³version´³refµ„³Version„„³ definitions´³named³ definitions´³refµ„³ Definitions„„³ embeddedType´³named³ embeddedType´³refµ„³EmbeddedTypeName„„„„„„„³Binding´³rec´³lit³named„´³tupleµ´³named³name´³atom³Symbol„„´³named³pattern´³refµ„³ SimplePattern„„„„„³Modules´³dictof´³refµ„³ +ModulePath„´³refµ„³Schema„„³Pattern´³orµµ± SimplePattern´³refµ„³ SimplePattern„„µ±CompoundPattern´³refµ„³CompoundPattern„„„„³Version´³lit‘„³AtomKind´³orµµ±Boolean´³lit³Boolean„„µ±Float´³lit³Float„„µ±Double´³lit³Double„„µ± SignedInteger´³lit³ SignedInteger„„µ±String´³lit³String„„µ± +ByteString´³lit³ +ByteString„„µ±Symbol´³lit³Symbol„„„„³ +Definition´³orµµ±or´³rec´³lit³or„´³tupleµ´³ tuplePrefixµ´³named³pattern0´³refµ„³NamedAlternative„„´³named³pattern1´³refµ„³NamedAlternative„„„´³named³patternN´³seqof´³refµ„³NamedAlternative„„„„„„„„µ±and´³rec´³lit³and„´³tupleµ´³ tuplePrefixµ´³named³pattern0´³refµ„³ NamedPattern„„´³named³pattern1´³refµ„³ NamedPattern„„„´³named³patternN´³seqof´³refµ„³ NamedPattern„„„„„„„„µ±Pattern´³refµ„³Pattern„„„„³ +ModulePath´³seqof´³atom³Symbol„„³ Definitions´³dictof´³atom³Symbol„´³refµ„³ +Definition„„³ NamedPattern´³orµµ±named´³refµ„³Binding„„µ± anonymous´³refµ„³Pattern„„„„³ SimplePattern´³orµµ±any´³lit³any„„µ±atom´³rec´³lit³atom„´³tupleµ´³named³atomKind´³refµ„³AtomKind„„„„„„µ±embedded´³rec´³lit³embedded„´³tupleµ´³named³ interface´³refµ„³ SimplePattern„„„„„„µ±lit´³rec´³lit³lit„´³tupleµ´³named³value³any„„„„„µ±seqof´³rec´³lit³seqof„´³tupleµ´³named³pattern´³refµ„³ SimplePattern„„„„„„µ±setof´³rec´³lit³setof„´³tupleµ´³named³pattern´³refµ„³ SimplePattern„„„„„„µ±dictof´³rec´³lit³dictof„´³tupleµ´³named³key´³refµ„³ SimplePattern„„´³named³value´³refµ„³ SimplePattern„„„„„„µ±Ref´³refµ„³Ref„„„„³CompoundPattern´³orµµ±rec´³rec´³lit³rec„´³tupleµ´³named³label´³refµ„³ NamedPattern„„´³named³fields´³refµ„³ NamedPattern„„„„„„µ±tuple´³rec´³lit³tuple„´³tupleµ´³named³patterns´³seqof´³refµ„³ NamedPattern„„„„„„„µ± tuplePrefix´³rec´³lit³ tuplePrefix„´³tupleµ´³named³fixed´³seqof´³refµ„³ NamedPattern„„„´³named³variable´³refµ„³NamedSimplePattern„„„„„„µ±dict´³rec´³lit³dict„´³tupleµ´³named³entries´³refµ„³DictionaryEntries„„„„„„„„³EmbeddedTypeName´³orµµ±Ref´³refµ„³Ref„„µ±false´³lit€„„„„³NamedAlternative´³tupleµ´³named³ variantLabel´³atom³String„„´³named³pattern´³refµ„³Pattern„„„„³DictionaryEntries´³dictof³any´³refµ„³NamedSimplePattern„„³NamedSimplePattern´³orµµ±named´³refµ„³Binding„„µ± anonymous´³refµ„³ SimplePattern„„„„„³ embeddedType€„„ \ No newline at end of file diff --git a/implementations/python/preserves/schema.py b/implementations/python/preserves/schema.py index 5bef146..0e19010 100644 --- a/implementations/python/preserves/schema.py +++ b/implementations/python/preserves/schema.py @@ -423,7 +423,7 @@ def extend(cls): return f return extender -__metaschema_filename = pathlib.Path(__file__).parent / '../../../schema/schema.bin' +__metaschema_filename = pathlib.Path(__file__).parent / 'schema.prb' meta = load_schema_file(__metaschema_filename).schema if __name__ == '__main__': diff --git a/implementations/python/setup.py b/implementations/python/setup.py index 6bde701..f8f739a 100644 --- a/implementations/python/setup.py +++ b/implementations/python/setup.py @@ -5,7 +5,7 @@ except ImportError: setup( name="preserves", - version="0.7.0", + version="0.7.1", author="Tony Garnock-Jones", author_email="tonyg@leastfixedpoint.com", license="Apache Software License",