├── .gitignore ├── IDEAS.md ├── LICENSE ├── MANIFEST ├── README.md ├── go ├── LICENSE ├── MANIFEST ├── README.md ├── Version.dat ├── go.mod ├── go.sum ├── st.sh ├── uxf.go └── uxf_test.go ├── misc ├── epd2uxf.py ├── fixversion.py ├── md2html.sh ├── t │ ├── robots.txt │ └── ttype-eg.uxf └── test_server.py ├── py ├── LICENSE ├── MANIFEST.in ├── README.md ├── eg │ ├── Config.py │ ├── README.md │ ├── Tlm.py │ ├── include.py │ ├── merge.py │ ├── slides.py │ ├── slides.sld │ └── visit.py ├── pypi.sh ├── setup.py ├── t │ ├── benchmark.py │ ├── gen.py │ ├── regression.py │ ├── test_compare.py │ ├── test_editabletuple.py │ ├── test_errors.py │ ├── test_imports.py │ ├── test_include.py │ ├── test_lints.py │ ├── test_merge.py │ ├── test_sqlite.py │ ├── test_table.py │ ├── test_tlm.py │ ├── test_use_config.py │ ├── test_visit.py │ └── util.py ├── uxf.py ├── uxfcompare.py ├── uxfconvert.py └── uxflint.py ├── regression.py ├── rs ├── .rustfmt.toml ├── Cargo.lock ├── Cargo.toml ├── LICENSE ├── README.md ├── deploy.bat ├── deploy.sh ├── src │ ├── bin │ │ └── uxf.rs │ ├── check.rs │ ├── consts.rs │ ├── event.rs │ ├── field.rs │ ├── format.rs │ ├── key.rs │ ├── lib.rs │ ├── list.rs │ ├── map.rs │ ├── parser │ │ ├── lexer.rs │ │ ├── mod.rs │ │ ├── parse.rs │ │ └── token.rs │ ├── pprint │ │ ├── mod.rs │ │ ├── to_text.rs │ │ ├── token.rs │ │ ├── tokenizer.rs │ │ └── writer.rs │ ├── table.rs │ ├── tclass.rs │ ├── util.rs │ ├── uxf.rs │ └── value.rs ├── tests │ ├── test_field.rs │ ├── test_list.rs │ ├── test_map.rs │ ├── test_table.rs │ ├── test_tclass.rs │ ├── test_uxf.rs │ ├── test_value.rs │ └── utils │ │ └── mod.rs └── uxf.ico ├── st.sh ├── testdata ├── 0.csv ├── 1.csv ├── 2.csv ├── big.uxd.gz ├── e120.uxe ├── e130.uxe ├── e141.uxe ├── e151.uxe ├── e160.uxe ├── e170.uxe ├── e190.uxe ├── e195.uxe ├── e200.uxe ├── e210.uxe ├── e240.uxe ├── e241.uxe ├── e248.uxe ├── e260.uxe ├── e269.uxe ├── e270.uxe ├── e273.uxe ├── e294.uxe ├── e308.uxe ├── e334.uxe ├── e402.uxe ├── e410.uxe ├── e422.uxe ├── e446.uxe ├── e450.uxe ├── e450b.uxe ├── e456.uxe ├── e500.uxe ├── e506.uxe ├── e523.uxe ├── e550.uxe ├── e560.uxe ├── e58-rs.txt ├── e58.txt ├── e601.uxe ├── e87.uxi ├── e88.uxi ├── e89.uxi ├── empty.uxe ├── errortests.dat.gz ├── expected │ ├── 0.uxf │ ├── 1-2-csv.uxf │ ├── 1.uxf │ ├── 2.uxf │ ├── big.uxd.gz │ ├── e102-rs-win.txt │ ├── e102-rs.txt │ ├── e102.txt │ ├── e110.txt │ ├── e120.txt │ ├── e13.txt │ ├── e130-rs.txt │ ├── e130.txt │ ├── e14.txt │ ├── e141.txt │ ├── e151.txt │ ├── e160-rs.txt │ ├── e160.txt │ ├── e170-rs.txt │ ├── e170.txt │ ├── e180.txt │ ├── e190.txt │ ├── e195-rs.txt │ ├── e195.txt │ ├── e200.txt │ ├── e210-rs.txt │ ├── e210.txt │ ├── e240-rs.txt │ ├── e240.txt │ ├── e241-rs.txt │ ├── e241.txt │ ├── e248-rs.txt │ ├── e248.txt │ ├── e260-rs.txt │ ├── e260.txt │ ├── e269.txt │ ├── e270-rs.txt │ ├── e270.txt │ ├── e273-rs.txt │ ├── e273.txt │ ├── e28.txt │ ├── e294-rs.txt │ ├── e294.txt │ ├── e308-rs.txt │ ├── e308.txt │ ├── e33-rs.txt │ ├── e33.txt │ ├── e334.txt │ ├── e402.txt │ ├── e410-rs.txt │ ├── e410.txt │ ├── e422.txt │ ├── e446.txt │ ├── e450-rs.txt │ ├── e450.txt │ ├── e450b-rs.txt │ ├── e450b.txt │ ├── e456-rs.txt │ ├── e456.txt │ ├── e500-rs.txt │ ├── e500.txt │ ├── e506-rs.txt │ ├── e506.txt │ ├── e523-rs.txt │ ├── e523.txt │ ├── e54.txt │ ├── e55.txt │ ├── e550.txt │ ├── e56-rs.txt │ ├── e56.txt │ ├── e560.txt │ ├── e57-rs.txt │ ├── e57.txt │ ├── e58-rs.txt │ ├── e58.txt │ ├── e59.txt │ ├── e60-rs.txt │ ├── e60.txt │ ├── e601.txt │ ├── e601b.txt │ ├── e62.txt │ ├── e63.txt │ ├── e63r.txt │ ├── e64-rs.txt │ ├── e64.txt │ ├── e65-rs.txt │ ├── e65.txt │ ├── e66-rs.txt │ ├── e66.txt │ ├── e67.txt │ ├── e69.txt │ ├── e72.txt │ ├── e86-rs.txt │ ├── e86.txt │ ├── e87-rs-win.txt │ ├── e87-rs.txt │ ├── e87.txt │ ├── e88-rs.txt │ ├── e88.txt │ ├── e89-rs.txt │ ├── e89.txt │ ├── empty.txt │ ├── epair1.txt │ ├── epair2.txt │ ├── epairimportc-rs.txt │ ├── epairimportc.txt │ ├── i67.uxf.gz │ ├── i67c.uxf.gz │ ├── i68.uxi │ ├── i68inc.uxf.gz │ ├── i69.uxi │ ├── ini.uxf │ ├── l56.json │ ├── l56.uxf │ ├── l56.xml │ ├── l56c.uxf.gz │ ├── l57.json │ ├── l57.uxf │ ├── l57.xml │ ├── l58.json │ ├── l58.uxf │ ├── l58.xml │ ├── l59.json │ ├── l59.uxf │ ├── l59.xml │ ├── l60.json │ ├── l60.uxf │ ├── l60.xml │ ├── l86.uxf │ ├── m1.uxf.gz │ ├── m2.uxf.gz │ ├── pair1.uxt │ ├── pair2.uxt │ ├── pairimportd.uxi │ ├── t0.json │ ├── t0.uxf │ ├── t0.xml │ ├── t0c.uxf.gz │ ├── t1.csv │ ├── t1.json │ ├── t1.uxf │ ├── t1.xml │ ├── t10.json │ ├── t10.uxf │ ├── t10.xml │ ├── t10c.uxf.gz │ ├── t11.json │ ├── t11.uxf │ ├── t11.xml │ ├── t11c.uxf.gz │ ├── t12.json │ ├── t12.uxf │ ├── t12.xml │ ├── t12c.uxf.gz │ ├── t13.json │ ├── t13.uxf │ ├── t13.xml │ ├── t14.json │ ├── t14.uxf │ ├── t14.xml │ ├── t15.json │ ├── t15.uxf │ ├── t15.xml │ ├── t16.json │ ├── t16.uxf │ ├── t16.xml │ ├── t17.json │ ├── t17.uxf │ ├── t17.xml │ ├── t18.json │ ├── t18.uxf │ ├── t18.xml │ ├── t19.json │ ├── t19.uxf │ ├── t19.xml │ ├── t1c.uxf.gz │ ├── t2.csv │ ├── t2.json │ ├── t2.uxf │ ├── t2.xml │ ├── t20.json │ ├── t20.uxf │ ├── t20.xml │ ├── t21.json │ ├── t21.uxf │ ├── t21.xml │ ├── t22.json │ ├── t22.uxf │ ├── t22.xml │ ├── t23.json │ ├── t23.uxf │ ├── t23.xml │ ├── t24.json │ ├── t24.uxf │ ├── t24.xml │ ├── t25.json │ ├── t25.uxf │ ├── t25.xml │ ├── t26.json │ ├── t26.uxf │ ├── t26.xml │ ├── t27.json │ ├── t27.uxf │ ├── t27.xml │ ├── t28.json │ ├── t28.uxf │ ├── t28.xml │ ├── t29.json │ ├── t29.uxf │ ├── t29.xml │ ├── t2c.uxf.gz │ ├── t3.json │ ├── t3.uxf │ ├── t3.xml │ ├── t30.json │ ├── t30.uxf │ ├── t30.xml │ ├── t31.json │ ├── t31.uxf │ ├── t31.xml │ ├── t32.json │ ├── t32.uxf │ ├── t32.xml │ ├── t33.json │ ├── t33.uxf │ ├── t33.xml │ ├── t34.json │ ├── t34.uxf │ ├── t34.xml │ ├── t35.json │ ├── t35.uxf │ ├── t35.xml │ ├── t36.json │ ├── t36.uxf │ ├── t36.xml │ ├── t37.json │ ├── t37.uxf │ ├── t37.xml │ ├── t38.json │ ├── t38.uxf │ ├── t38.xml │ ├── t38c.uxf.gz │ ├── t39.json │ ├── t39.uxf │ ├── t39.xml │ ├── t3c.uxf.gz │ ├── t4.json │ ├── t4.uxf │ ├── t4.xml │ ├── t40.json │ ├── t40.uxf │ ├── t40.xml │ ├── t41.json │ ├── t41.uxf │ ├── t41.xml │ ├── t42.json │ ├── t42.uxf │ ├── t42.xml │ ├── t43.json │ ├── t43.uxf │ ├── t43.xml │ ├── t44.json │ ├── t44.uxf │ ├── t44.xml │ ├── t45.json │ ├── t45.uxf │ ├── t45.xml │ ├── t46.json │ ├── t46.uxf │ ├── t46.xml │ ├── t47.json │ ├── t47.uxf │ ├── t47.xml │ ├── t48.json │ ├── t48.uxf │ ├── t48.xml │ ├── t49.json │ ├── t49.uxf │ ├── t49.xml │ ├── t4c.uxf.gz │ ├── t5.json │ ├── t5.uxf │ ├── t5.xml │ ├── t50.json │ ├── t50.uxf │ ├── t50.xml │ ├── t51.json │ ├── t51.uxf │ ├── t51.xml │ ├── t52.json │ ├── t52.uxf │ ├── t52.xml │ ├── t53.json │ ├── t53.uxf │ ├── t53.xml │ ├── t54.json │ ├── t54.uxf │ ├── t54.xml │ ├── t55.json │ ├── t55.uxf │ ├── t55.xml │ ├── t5c.uxf.gz │ ├── t5err.txt │ ├── t5tree.txt │ ├── t6.json │ ├── t6.uxf │ ├── t6.xml │ ├── t61.json │ ├── t61.uxf │ ├── t61.xml │ ├── t62.json │ ├── t62.uxf │ ├── t62.xml │ ├── t63.json │ ├── t63.uxf │ ├── t63.xml │ ├── t63r.json │ ├── t63r.uxf │ ├── t63r.xml │ ├── t6c.uxf.gz │ ├── t7.json │ ├── t7.uxf │ ├── t7.xml │ ├── t70.json │ ├── t70.uxf │ ├── t70.xml │ ├── t71.json │ ├── t71.uxf │ ├── t71.xml │ ├── t72.uxi │ ├── t72d.uxf │ ├── t72l.uxf │ ├── t72r.uxf │ ├── t73.json │ ├── t73.uxf │ ├── t73.xml │ ├── t74.json │ ├── t74.uxf │ ├── t74.xml │ ├── t75.json │ ├── t75.uxf │ ├── t75.xml │ ├── t76.json │ ├── t76.uxf │ ├── t76.xml │ ├── t77.json │ ├── t77.uxf │ ├── t77.xml │ ├── t78.json │ ├── t78.uxf │ ├── t78.xml │ ├── t79.json │ ├── t79.uxf │ ├── t79.xml │ ├── t7c.uxf.gz │ ├── t8.json │ ├── t8.uxf │ ├── t8.xml │ ├── t80.json │ ├── t80.uxf │ ├── t80.xml │ ├── t81.json │ ├── t81.uxf │ ├── t81.xml │ ├── t82.json │ ├── t82.uxf │ ├── t82.xml │ ├── t83.json │ ├── t83.uxf │ ├── t83.xml │ ├── t84.json │ ├── t84.uxf │ ├── t84.xml │ ├── t85.json │ ├── t85.uxf │ ├── t85.xml │ ├── t86.json │ ├── t86.uxf │ ├── t86.xml │ ├── t8c.uxf.gz │ ├── t9.json │ ├── t9.uxf │ ├── t9.xml │ ├── t9c.uxf.gz │ ├── tlm-eg1.uxx.gz │ ├── tlm-eg2.uxx.gz │ └── uxflint.txt ├── i64.uxi ├── i65.uxi ├── i66.uxi ├── i67.uxi ├── i68.uxi ├── i69.uxi ├── ini.ini ├── l56.uxf ├── l57.uxf ├── l58.uxf ├── l59.uxf ├── l60.uxf ├── l86.uxf ├── pair1.uxt ├── pair2.uxt ├── pairimportc.uxi ├── pairimportd.uxi ├── regression.dat.gz ├── t0.uxf ├── t1.uxf ├── t10.uxf ├── t11.uxf ├── t12.uxf ├── t13.uxf ├── t14.uxf ├── t15.uxf ├── t16.uxf ├── t17.uxf ├── t18.uxf ├── t19.uxf ├── t2.uxf ├── t20.uxf ├── t21.uxf ├── t22.uxf ├── t23.uxf ├── t24.uxf ├── t25.uxf ├── t26.uxf ├── t27.uxf ├── t28.uxf ├── t29.uxf ├── t3.uxf ├── t30.uxf ├── t31.uxf ├── t32.uxf ├── t33.uxf ├── t34.uxf ├── t35.uxf ├── t36.uxf ├── t37.uxf ├── t38.uxf ├── t39.uxf ├── t4.uxf ├── t40.uxf ├── t41.uxf ├── t42.uxf ├── t43.uxf ├── t44.uxf ├── t45.uxf ├── t46.uxf ├── t47.uxf ├── t48.uxf ├── t49.uxf ├── t5.uxf ├── t50.uxf ├── t51.uxf ├── t52.uxf ├── t53.uxf ├── t54.uxf ├── t55.uxf ├── t6.uxf ├── t61.uxf ├── t62.uxf ├── t63.uxf ├── t63.uxt ├── t63r.uxf ├── t7.uxf ├── t70.uxf ├── t71.uxf ├── t72.uxi ├── t73.uxf ├── t74.uxf ├── t75.uxf ├── t76.uxf ├── t77.uxf ├── t78.uxf ├── t79.uxf ├── t8.uxf ├── t80.uxf ├── t81.uxf ├── t82.uxf ├── t83.uxf ├── t84.uxf ├── t85.uxf ├── t86.uxf ├── t9.uxf ├── tlm-eg1.uxx.gz ├── tlm-eg2.uxx.gz └── ttype-test.uxi ├── uxf.svg ├── uxf.vim └── x ├── rs ├── .rustfmt.toml ├── Cargo.lock ├── Cargo.toml └── src │ └── main.rs ├── x.py └── xx.py /.gitignore: -------------------------------------------------------------------------------- 1 | .#* 2 | [#]*# 3 | *~ 4 | *.a 5 | *.bak 6 | *.class 7 | *.dll 8 | *.exe 9 | gpl-[0-9].[0-9].txt 10 | *.ld 11 | *.ldx 12 | *.li 13 | *.lix 14 | louti[0-9]* 15 | moc_*.cpp 16 | nimcache 17 | *.o 18 | *.obj 19 | __pycache__ 20 | *.py[co] 21 | qrc_*.cpp 22 | Qrc.py 23 | *.rs.bk 24 | *.so 25 | *.sw[nop] 26 | .*.swp 27 | tags 28 | target/ 29 | *.tmp 30 | ui_*.h 31 | .wcignore 32 | *.jar 33 | GPLv3.txt 34 | .hg/ 35 | .hgignore 36 | .hgtags 37 | .stack-work/ 38 | *.cabal 39 | .dub/ 40 | dub.selections.json 41 | .sconsign.dblite 42 | .mypy_cache 43 | zig-cache 44 | *.html 45 | build/ 46 | dist/ 47 | py/uxf.egg-info/ 48 | testdata/actual 49 | benchmark.uxf.gz 50 | stats.py 51 | a.sh 52 | b??.sh 53 | rsclaptest 54 | -------------------------------------------------------------------------------- /go/MANIFEST: -------------------------------------------------------------------------------- 1 | uxf.go 2 | 3 | uxf_test.go 4 | 5 | README.md 6 | 7 | st.sh 8 | 9 | # vim: syn=yaml 10 | -------------------------------------------------------------------------------- /go/README.md: -------------------------------------------------------------------------------- 1 | # Go UXF Library 2 | 3 | Uniform eXchange Format (UXF) is a plain text human readable optionally 4 | typed storage format that supports custom types. 5 | 6 | UXF is designed to make life easier for software developers and data 7 | designers. It directly competes with csv, ini, json, toml, and yaml formats. 8 | A key advantage of UXF is its support for custom (i.e., user-defined) types. 9 | This can result in more compact, more readable, and easier to parse data. 10 | And in some contexts it may prove to be a convenient alternative to sqlite 11 | or xml. 12 | 13 | For details of the Uniform eXchange Format (UXF) supported by this library, 14 | see the [UXF Overview](../README.md). ([Go UXF 15 | Overview](https://pkg.go.dev/github.com/mark-summerfield/uxf).) 16 | 17 | **Hopefully someone else will implement Go Marshal() and Unmarshall() for 18 | UXF format…** _This could be an ideal—although challenging—computer science 19 | undergraduate final year project._ 20 | 21 | ## License 22 | 23 | Apache-2.0 24 | 25 | --- 26 | -------------------------------------------------------------------------------- /go/Version.dat: -------------------------------------------------------------------------------- 1 | 0.1.0 2 | -------------------------------------------------------------------------------- /go/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/mark-summerfield/uxf 2 | 3 | go 1.21.4 4 | -------------------------------------------------------------------------------- /go/go.sum: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /go/st.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | clc -s -e uxf_test.go 3 | cat Version.dat 4 | go mod tidy 5 | go fmt . 6 | staticcheck . 7 | go vet . 8 | golangci-lint run 9 | git st 10 | -------------------------------------------------------------------------------- /go/uxf.go: -------------------------------------------------------------------------------- 1 | // Copyright © 2023 Mark Summerfield. All rights reserved. 2 | // License: Apache-2.0 3 | 4 | package uxf 5 | 6 | import ( 7 | "fmt" 8 | _ "embed" 9 | ) 10 | 11 | //go:embed Version.dat 12 | var Version string 13 | 14 | func Hello() string { 15 | return fmt.Sprintf("Hello uxf v%s", Version) 16 | } 17 | -------------------------------------------------------------------------------- /go/uxf_test.go: -------------------------------------------------------------------------------- 1 | package uxf 2 | 3 | import ( 4 | "testing" 5 | ) 6 | 7 | func Test1(t *testing.T) { 8 | expected := "Hello uxf v0.1.0\n" 9 | actual := Hello() 10 | if actual != expected { 11 | t.Errorf("expected %q, got %q", expected, actual) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /misc/fixversion.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # Copyright © 2022 Qtrac Ltd. All rights reserved. 3 | 4 | import gzip 5 | import os 6 | import sys 7 | 8 | 9 | def main(): 10 | if len(sys.argv) > 1 and sys.argv[1] in {'-h', '--help'}: 11 | raise SystemExit('''usage: {} 12 | Fixes the version of all UXF files in the current directory and its 13 | subdirectories.'''.format(os.path.basename(sys.argv[0]))) 14 | count = 0 15 | for root, _, files in os.walk('.'): 16 | for filename in files: 17 | filename = os.path.join(root, filename) 18 | count == maybe_fix_version(filename) 19 | print(f'fixed {count:,} files') 20 | 21 | 22 | def maybe_fix_version(filename): 23 | opener = open 24 | try: 25 | try: 26 | with gzip.open(filename, 'rt', encoding='utf-8') as file: 27 | text = file.read() 28 | opener = gzip.open 29 | except gzip.BadGzipFile: 30 | with open(filename, 'rt', encoding='utf-8') as file: 31 | text = file.read() 32 | if text.startswith('uxf 1.0'): 33 | text = text[:5] + text[7:] 34 | with opener(filename, 'wt', encoding='utf-8') as file: 35 | file.write(text) 36 | print(f'fixed {filename}') 37 | return 1 38 | except OSError as err: 39 | print(err) 40 | return 0 41 | 42 | 43 | if __name__ == '__main__': 44 | main() 45 | -------------------------------------------------------------------------------- /misc/md2html.sh: -------------------------------------------------------------------------------- 1 | cmark-gfm -e table --width 78 -t html README.md > uxf.html 2 | cmark-gfm -e table --width 78 -t html IDEAS.md > ideas.html 3 | cmark-gfm -e table --width 78 -t html py/README.md > py/uxf-py.html 4 | cmark-gfm -e table --width 78 -t html py/eg/README.md > py/eg/uxf-py-eg.html 5 | cmark-gfm -e table --width 78 -t html rs/README.md > rs/uxf-rs.html 6 | -------------------------------------------------------------------------------- /misc/t/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: /cgi-bin/ 3 | Disallow: /logs/ 4 | Disallow: /tmp/ 5 | Disallow: /~mark/ 6 | Disallow: /*.msi 7 | Disallow: /*.zip 8 | Disallow: /*.html/*$ 9 | Disallow: /*.tar.gz 10 | Disallow: /*.7z 11 | Sitemap: http://www.qtrac.eu/sitemap.xml 12 | 13 | User-agent: MJ12bot 14 | Disallow: / 15 | -------------------------------------------------------------------------------- /misc/t/ttype-eg.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 Slides 0.1.0 2 | # 4 | = Slide title body 5 | = # h1 content 6 | = #<subtitle> h2 content 7 | = #<bullet item> B content 8 | = #<para> p content 9 | = #<image> img content image:bytes 10 | = #<monospace inline> m content 11 | = #<monospace block> pre content 12 | = #<italic> i content 13 | = url content link 14 | = #<newline with no content> nl 15 | [] 16 | -------------------------------------------------------------------------------- /misc/test_server.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import http.server 4 | import os 5 | import socketserver 6 | 7 | PORT = 5558 8 | 9 | os.chdir(os.path.dirname(__file__) + '/t') 10 | 11 | 12 | class Handler(http.server.SimpleHTTPRequestHandler): 13 | 14 | def log_message(self, format, *args): 15 | pass 16 | 17 | 18 | with socketserver.TCPServer(('', PORT), Handler) as httpd: 19 | print(f'test_server.py on port {PORT}') 20 | httpd.serve_forever() 21 | -------------------------------------------------------------------------------- /py/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include LICENSE 2 | -------------------------------------------------------------------------------- /py/eg/include.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # Copyright © 2022 Mark Summerfield. All rights reserved. 3 | # License: GPLv3 4 | 5 | ''' 6 | See eg/merge.py for more about the merge() function. 7 | 8 | Example 'include' file: 9 | 10 | uxf 1 UXF Include 11 | #<e.g., include.uxf> 12 | =include filename:str 13 | (include 14 | <file1.uxf> 15 | <file2.uxf> 16 | <file3.uxf> 17 | ) 18 | ''' 19 | 20 | import os 21 | import sys 22 | 23 | import merge 24 | 25 | try: 26 | import uxf 27 | except ImportError: # needed for development 28 | sys.path.append(os.path.abspath(os.path.dirname(__file__) + '/..')) 29 | import uxf 30 | 31 | 32 | def main(): 33 | if len(sys.argv) < 2 or sys.argv[1] in {'-h', '--help'}: 34 | raise SystemExit('usage: include.py <include.uxf> [<outfile.uxf>]') 35 | include_uxo = uxf.load(sys.argv[1]) 36 | filenames = [record.filename for record in include_uxo.value] 37 | uxo = merge.merge(*filenames, asmap=False) 38 | if len(sys.argv) > 2: 39 | uxo.dump(sys.argv[2]) 40 | else: 41 | print(uxo.dumps()) 42 | 43 | 44 | if __name__ == '__main__': 45 | main() 46 | -------------------------------------------------------------------------------- /py/pypi.sh: -------------------------------------------------------------------------------- 1 | cd ~/app/uxf/py 2 | rm -rf build/ dist/ uxf.egg-info/ 3 | python3 setup.py sdist bdist_wheel 4 | twine upload dist/* && rm -rf build/ dist/ uxf.egg-info/ 5 | cd .. 6 | -------------------------------------------------------------------------------- /py/setup.py: -------------------------------------------------------------------------------- 1 | import pathlib 2 | import re 3 | 4 | import setuptools 5 | 6 | ROOT = pathlib.Path(__file__).parent 7 | 8 | README = (ROOT / 'README.md').read_text() 9 | INIT = (ROOT / 'uxf.py').read_text() 10 | match = re.search(r"__version__\s*=\s*'(?P<version>.*?)'", INIT) 11 | VERSION = match.group('version') 12 | 13 | setuptools.setup( 14 | name='uxf', 15 | version=VERSION, 16 | author='Mark Summerfield', 17 | author_email='mark@qtrac.eu', 18 | description='A pure Python library supporting Uniform eXchange Format, \ 19 | a plain text human readable optionally typed storage format that supports \ 20 | custom types.', 21 | long_description=README, 22 | long_description_content_type='text/markdown', 23 | url='https://github.com/mark-summerfield/uxf', 24 | license='GPLv3', 25 | classifiers=[ 26 | 'Development Status :: 5 - Production/Stable', 27 | 'Intended Audience :: Developers', 28 | 'License :: OSI Approved :: GNU General Public License v3 (GPLv3)', 29 | 'Programming Language :: Python :: 3', 30 | 'Programming Language :: Python :: 3.8', 31 | 'Topic :: Software Development :: Libraries'], 32 | package_dir={'': '.'}, 33 | py_modules=['uxf'], 34 | scripts=['uxfconvert.py', 'uxfcompare.py', 'uxflint.py'], 35 | python_requires='>=3.8', 36 | install_requires=['editabletuple']) 37 | -------------------------------------------------------------------------------- /py/t/test_visit.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # Copyright © 2022 Mark Summerfield. All rights reserved. 3 | # License: GPLv3 4 | 5 | import contextlib 6 | import filecmp 7 | import io 8 | import os 9 | import sys 10 | 11 | try: 12 | PATH = os.path.abspath(os.path.dirname(__file__)) 13 | sys.path.append(os.path.abspath(os.path.join(PATH, '../eg/'))) 14 | import visit 15 | os.chdir(os.path.join(PATH, '../../testdata')) # move to test data 16 | finally: 17 | pass 18 | 19 | 20 | def main(): 21 | total = ok = 0 22 | 23 | out = 't5tree.txt' 24 | err = 't5err.txt' 25 | actual_err = io.StringIO() 26 | with contextlib.redirect_stderr(actual_err): 27 | visit.visit('t5.uxf', f'actual/{out}') 28 | total = 2 29 | if filecmp.cmp(f'expected/{out}', f'actual/{out}', shallow=False): 30 | ok += 1 31 | with open(f'expected/{err}', 'rt', encoding='utf-8') as file: 32 | expected_err = file.read() 33 | if expected_err == actual_err.getvalue(): 34 | ok += 1 35 | 36 | print(f'total={total} ok={ok}') 37 | 38 | 39 | if __name__ == '__main__': 40 | main() 41 | -------------------------------------------------------------------------------- /py/t/util.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # Copyright © 2022 Mark Summerfield. All rights reserved. 3 | # License: GPLv3 4 | 5 | import os 6 | import subprocess 7 | 8 | 9 | def check_server(path=None): 10 | reply = subprocess.run(['nc', '-vz', 'localhost', '5558'], 11 | stdout=subprocess.DEVNULL, 12 | stderr=subprocess.DEVNULL) 13 | if reply.returncode != 0: 14 | subprocess.Popen(['nohup', './test_server.py'], 15 | cwd=path, stdout=subprocess.DEVNULL, 16 | stderr=subprocess.DEVNULL, 17 | preexec_fn=os.setpgrp).pid 18 | -------------------------------------------------------------------------------- /py/uxflint.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # Copyright © 2022 Mark Summerfield. All rights reserved. 3 | # License: GPLv3 4 | 5 | import os 6 | import sys 7 | 8 | import uxf 9 | 10 | 11 | def main(): 12 | if len(sys.argv) == 1 or sys.argv[1] in {'-h', '--help'}: 13 | raise SystemExit('usage: uxflint.py <file1> [file2 [file3 ...]]') 14 | for filename in sys.argv[1:]: 15 | if os.path.isfile(filename): 16 | try: 17 | uxf.load(filename, on_event=on_event) 18 | except (uxf.Error, OSError) as err: 19 | print(f'uxflint.py:{filename}:{err}') 20 | 21 | 22 | def on_event(*args, **kwargs): 23 | kwargs['prefix'] = 'uxflint' 24 | print(uxf.Error(*args, **kwargs)) 25 | 26 | 27 | if __name__ == '__main__': 28 | main() 29 | -------------------------------------------------------------------------------- /rs/.rustfmt.toml: -------------------------------------------------------------------------------- 1 | edition = "2021" 2 | max_width = 76 3 | # comment_width = 76 4 | use_small_heuristics = "Max" 5 | use_field_init_shorthand = true 6 | # wrap_comments = true 7 | # fn_args_density = "Compressed" 8 | # format_strings = true 9 | # merge_imports = true 10 | # reorder_impl_items = true 11 | -------------------------------------------------------------------------------- /rs/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "uxf" 3 | version = "1.2.5" 4 | edition = "2021" 5 | publish = true 6 | authors = [ "Mark Summerfield <mark@qtrac.eu>",] 7 | include = [ "Cargo.toml", "src/**/*.rs", "examples/**/*.rs",] 8 | description = "uxf supports the UXF plain text human readable optionally typed storage format that supports custom types. UXF may serve as a convenient alternative to csv, ini, json, sqlite, toml, xml, or yaml." 9 | documentation = "https://docs.rs/uxf/latest/uxf/" 10 | homepage = "https://github.com/mark-summerfield/uxf" 11 | repository = "https://github.com/mark-summerfield/uxf" 12 | readme = "README.md" 13 | keywords = [ "parser", "database", "uxf", "serialization", "configuration",] 14 | categories = [ "development-tools", "text-processing", "config", "parser-implementations", "database",] 15 | license = "GPL-3.0" 16 | 17 | [dependencies] 18 | anyhow = "^1.0" 19 | bitflags = "^1.3" 20 | chrono = "^0.4" 21 | flate2 = "^1.0" 22 | indexmap = "^1.9" 23 | regex = "^1.6" 24 | 25 | [dependencies.reqwest] 26 | version = "^0.11" 27 | features = [ "blocking",] 28 | 29 | [dependencies.clap] 30 | version = "^4" 31 | features = [ "derive", "wrap_help",] 32 | 33 | [badges.maintenance] 34 | status = "passively-maintained" 35 | 36 | [profile.release] 37 | strip = true 38 | opt-level = 3 39 | lto = true 40 | -------------------------------------------------------------------------------- /rs/deploy.bat: -------------------------------------------------------------------------------- 1 | SET CARGO_TARGET_DIR=target 2 | SET RELEASE_DIR=%CARGO_TARGET_DIR%\release 3 | cargo build --release -- %* 4 | copy /Y target\release\uxf.exe . 5 | rcedit uxf.exe --set-icon uxf.ico 6 | copy /Y uxf.exe C:\bin 7 | -------------------------------------------------------------------------------- /rs/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | if [ $(pwd) != $HOME/app/uxf/rs ] 3 | then 4 | cd rs 5 | fi 6 | cargo build --release 7 | cp -f $HOME/app/uxf/rs/target/release/uxf $HOME/opt/bin/uxf 8 | -------------------------------------------------------------------------------- /rs/src/parser/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright © 2022 Mark Summerfield. All rights reserved. 2 | // License: GPLv3 3 | 4 | /*! The UXF parser; only the parse() and parse_options() are public. */ 5 | mod lexer; 6 | mod parse; 7 | mod token; 8 | 9 | pub(crate) use crate::parser::parse::parse; 10 | -------------------------------------------------------------------------------- /rs/src/pprint/mod.rs: -------------------------------------------------------------------------------- 1 | // Copyright © 2022 Mark Summerfield. All rights reserved. 2 | // License: GPLv3 3 | 4 | /*! The UXF pretty printer; all this is private. (See the Uxf::to_text() 5 | and Uxf::to_text_options() methods both of which use this module 6 | internally.) 7 | */ 8 | mod to_text; 9 | mod token; 10 | mod tokenizer; 11 | mod writer; 12 | 13 | pub(crate) use crate::pprint::to_text::to_text; 14 | -------------------------------------------------------------------------------- /rs/src/pprint/to_text.rs: -------------------------------------------------------------------------------- 1 | // Copyright © 2022 Mark Summerfield. All rights reserved. 2 | // License: GPLv3 3 | 4 | use crate::consts::UXF_VERSION; 5 | use crate::format::Format; 6 | use crate::pprint::{tokenizer::tokenize, writer}; 7 | use crate::uxf::Uxf; 8 | 9 | pub(crate) fn to_text(uxo: &Uxf, format: &Format) -> String { 10 | let header = header(uxo.custom()); 11 | let tokens = tokenize( 12 | uxo, 13 | format, 14 | uxo.tclass_for_ttype.clone(), 15 | uxo.import_for_ttype.clone(), 16 | ); 17 | writer::to_text(&header, tokens, format) 18 | } 19 | 20 | fn header(custom: &str) -> String { 21 | let mut text = format!("uxf {UXF_VERSION}"); 22 | if !custom.is_empty() { 23 | text.push(' '); 24 | text.push_str(custom); 25 | } 26 | text.push('\n'); 27 | text 28 | } 29 | -------------------------------------------------------------------------------- /rs/tests/test_value.rs: -------------------------------------------------------------------------------- 1 | // Copyright © 2022 Mark Summerfield. All rights reserved. 2 | // License: GPLv3 3 | 4 | use uxf::value::Value; 5 | 6 | #[test] 7 | fn t_single_value() { 8 | let n = Value::Null; 9 | assert_eq!(n.to_string(), "?"); 10 | assert_eq!(n.typename(), "null"); 11 | let b: Value = true.into(); 12 | assert_eq!(b.to_string(), "yes"); 13 | assert_eq!(b.typename(), "bool"); 14 | let b = Value::Bool(false); 15 | assert_eq!(b.to_string(), "no"); 16 | assert_eq!(b.typename(), "bool"); 17 | let i: Value = 987123.into(); 18 | assert_eq!(i.to_string(), "987123"); 19 | assert_eq!(i.typename(), "int"); 20 | let b = Value::from(false); 21 | assert_eq!(b.to_string(), "no"); 22 | assert_eq!(b.typename(), "bool"); 23 | let i = Value::from(987123); 24 | assert_eq!(i.to_string(), "987123"); 25 | assert_eq!(i.typename(), "int"); 26 | } 27 | 28 | /* 29 | #[test] 30 | fn t_visit() { 31 | // TODO 32 | } 33 | */ 34 | -------------------------------------------------------------------------------- /rs/uxf.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mark-summerfield/uxf/847bfe0ded4499bfbe8eda15f1d107a94654f448/rs/uxf.ico -------------------------------------------------------------------------------- /st.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd $HOME/app/uxf 3 | #tokei -C -f -slines -tPython -esetup.py -eeg -emisc -ex/ -epy/t \ 4 | # -eregression.py -echeck_lexer.py 5 | #tokei -C -f -tRust -etarget -e rs/tests -e x/rs \ 6 | # | grep -v '^-- ' | grep -v '|-' 7 | #tokei -C -f -t"C++,C++ Header" -e c++/dist -e c++/build -e c++/src/t.cpp \ 8 | # | grep -v '^-- ' | grep -v '|-' 9 | clc -e t.cpp misc eg x t tests regression.py 10 | unrecognized.py -q 11 | python3 -m flake8 --ignore=W504,W503,E261,E303 . 12 | python3 -m vulture . | grep -v 60%.confidence 13 | # python3 -m vulture py/uxf.py 14 | git st 15 | -------------------------------------------------------------------------------- /testdata/0.csv: -------------------------------------------------------------------------------- 1 | 4,"ABBA",2,False 2 | 38,"Bach",5,False 3 | 39,"Bartok",5,False 4 | 5,"Beatles",2,False 5 | 40,"Beethoven",5,False 6 | 6,"Blondie",2,False 7 | 52,"Bob Marley",6,True 8 | 7,"Bruce Springsteen",2,False 9 | 41,"Chopin",5,True 10 | 37,"Classical & <Special>",5,False 11 | 8,"David Bowie",2,False 12 | -------------------------------------------------------------------------------- /testdata/1.csv: -------------------------------------------------------------------------------- 1 | "CID","Name","Selected" 2 | 5,"Classical",True 3 | 4,"Modern Instrumental & <Experimental>",False 4 | 1,"New Acquistions",False 5 | 2,"Pop",False 6 | 3,"Punk",False 7 | 7,"Uncategorized",False 8 | 6,"Unpopular Pop",False 9 | -------------------------------------------------------------------------------- /testdata/2.csv: -------------------------------------------------------------------------------- 1 | "TID","Artist","CID","Selected" 2 | 4,"ABBA",2,False 3 | 38,"Bach",5,False 4 | 39,"Bartok",5,False 5 | 5,"Beatles",2,False 6 | 40,"Beethoven",5,False 7 | 6,"Blondie",2,False 8 | 52,"Bob Marley",6,True 9 | 7,"Bruce Springsteen",2,False 10 | 41,"Chopin",5,True 11 | 37,"Classical & <Special>",5,False 12 | 8,"David Bowie",2,False 13 | -------------------------------------------------------------------------------- /testdata/big.uxd.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mark-summerfield/uxf/847bfe0ded4499bfbe8eda15f1d107a94654f448/testdata/big.uxd.gz -------------------------------------------------------------------------------- /testdata/e120.uxe: -------------------------------------------------------------------------------- 1 | abc 2 | -------------------------------------------------------------------------------- /testdata/e130.uxe: -------------------------------------------------------------------------------- 1 | uxf 1 2 | 3 | -------------------------------------------------------------------------------- /testdata/e141.uxe: -------------------------------------------------------------------------------- 1 | uxf 9 2 | [] 3 | -------------------------------------------------------------------------------- /testdata/e151.uxe: -------------------------------------------------------------------------------- 1 | uxf E1 2 | {} 3 | -------------------------------------------------------------------------------- /testdata/e160.uxe: -------------------------------------------------------------------------------- 1 | uxf 1 2 | #[invalid comment syntax> 3 | [] 4 | -------------------------------------------------------------------------------- /testdata/e170.uxe: -------------------------------------------------------------------------------- 1 | uxf 1 2 | [1 2 $ 4] 3 | -------------------------------------------------------------------------------- /testdata/e190.uxe: -------------------------------------------------------------------------------- 1 | uxf 1 2 | [1 2 #<three> 4] 3 | -------------------------------------------------------------------------------- /testdata/e195.uxe: -------------------------------------------------------------------------------- 1 | uxf 1 2 | [1 2 & <three> 4] 3 | -------------------------------------------------------------------------------- /testdata/e200.uxe: -------------------------------------------------------------------------------- 1 | uxf 1 2 | [1 2 (:ABCDEFGH:)] 3 | -------------------------------------------------------------------------------- /testdata/e210.uxe: -------------------------------------------------------------------------------- 1 | uxf 1 2 | [-3e4e] 3 | -------------------------------------------------------------------------------- /testdata/e240.uxe: -------------------------------------------------------------------------------- 1 | uxf 1 2 | [2021-11-05T4:] 3 | -------------------------------------------------------------------------------- /testdata/e241.uxe: -------------------------------------------------------------------------------- 1 | uxf 1 2 | [2022-123-19] 3 | -------------------------------------------------------------------------------- /testdata/e248.uxe: -------------------------------------------------------------------------------- 1 | uxf 1 2 | [a:int] 3 | -------------------------------------------------------------------------------- /testdata/e260.uxe: -------------------------------------------------------------------------------- 1 | uxf 1 2 | =A b: 3 | (A 1) 4 | -------------------------------------------------------------------------------- /testdata/e269.uxe: -------------------------------------------------------------------------------- 1 | uxf 1 2 | [(:ABC:] 3 | -------------------------------------------------------------------------------- /testdata/e270.uxe: -------------------------------------------------------------------------------- 1 | uxf 1 2 | [<a] 3 | -------------------------------------------------------------------------------- /testdata/e273.uxe: -------------------------------------------------------------------------------- 1 | uxf 1 2 | {thing} 3 | -------------------------------------------------------------------------------- /testdata/e294.uxe: -------------------------------------------------------------------------------- 1 | uxf 1 2 | {[] 1} 3 | -------------------------------------------------------------------------------- /testdata/e308.uxe: -------------------------------------------------------------------------------- 1 | uxf 1 2 | {bool} 3 | -------------------------------------------------------------------------------- /testdata/e334.uxe: -------------------------------------------------------------------------------- 1 | uxf 1 2 | =A 3 | (A 1) 4 | -------------------------------------------------------------------------------- /testdata/e402.uxe: -------------------------------------------------------------------------------- 1 | uxf 1 2 | 5 3 | -------------------------------------------------------------------------------- /testdata/e410.uxe: -------------------------------------------------------------------------------- 1 | uxf 1 2 | [int 1 2 int] 3 | -------------------------------------------------------------------------------- /testdata/e422.uxe: -------------------------------------------------------------------------------- 1 | uxf 1 2 | =#<We don't warn about unused fieldless tables> Constant 3 | =Pair first second 4 | [] 5 | -------------------------------------------------------------------------------- /testdata/e446.uxe: -------------------------------------------------------------------------------- 1 | uxf 1 2 | [thing] 3 | -------------------------------------------------------------------------------- /testdata/e450.uxe: -------------------------------------------------------------------------------- 1 | uxf 1 2 | ( 3 | -------------------------------------------------------------------------------- /testdata/e450b.uxe: -------------------------------------------------------------------------------- 1 | uxf 1 2 | (int) 3 | -------------------------------------------------------------------------------- /testdata/e456.uxe: -------------------------------------------------------------------------------- 1 | uxf 1 2 | =A 3 | =B 4 | [A (B)] 5 | -------------------------------------------------------------------------------- /testdata/e500.uxe: -------------------------------------------------------------------------------- 1 | uxf 1 2 | =P a b 3 | =Q x:b 4 | (P 1 (Q 2)) 5 | -------------------------------------------------------------------------------- /testdata/e506.uxe: -------------------------------------------------------------------------------- 1 | uxf 1 2 | [int 1 2 {}] 3 | -------------------------------------------------------------------------------- /testdata/e523.uxe: -------------------------------------------------------------------------------- 1 | uxf 1 2 | = 3 | (A) 4 | -------------------------------------------------------------------------------- /testdata/e550.uxe: -------------------------------------------------------------------------------- 1 | uxf 1 2 | !http://localhost:5558/missing.uxi 3 | [1 2] 4 | -------------------------------------------------------------------------------- /testdata/e560.uxe: -------------------------------------------------------------------------------- 1 | uxf 1 2 | !absent 3 | [1 2] 4 | -------------------------------------------------------------------------------- /testdata/e58-rs.txt: -------------------------------------------------------------------------------- 1 | R486:/home/mark/app/uxf/testdata/l56.uxf:9:converted str <2> to int 2 2 | R486:/home/mark/app/uxf/testdata/l56.uxf:9:converted str <1983-04-07> to date 1983-04-07 3 | R486:/home/mark/app/uxf/testdata/l56.uxf:11:converted real 7.2 to int 7 4 | E488:/home/mark/app/uxf/testdata/l56.uxf:15:expected real, got <wrong> 5 | -------------------------------------------------------------------------------- /testdata/e601.uxe: -------------------------------------------------------------------------------- 1 | uxf 1 2 | [(:ab12f:)] 3 | -------------------------------------------------------------------------------- /testdata/e87.uxi: -------------------------------------------------------------------------------- 1 | uxf 1 2 | #<Test of missing import> 3 | !missing.uxi 4 | [] 5 | -------------------------------------------------------------------------------- /testdata/e88.uxi: -------------------------------------------------------------------------------- 1 | uxf 1 2 | #<Test of importing an import with a missing import> 3 | !e87.uxi 4 | [] 5 | -------------------------------------------------------------------------------- /testdata/e89.uxi: -------------------------------------------------------------------------------- 1 | uxf 1 2 | #<Test of missing import> 3 | !http://localhost:5558/missing.uxf 4 | [] 5 | -------------------------------------------------------------------------------- /testdata/empty.uxe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mark-summerfield/uxf/847bfe0ded4499bfbe8eda15f1d107a94654f448/testdata/empty.uxe -------------------------------------------------------------------------------- /testdata/errortests.dat.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mark-summerfield/uxf/847bfe0ded4499bfbe8eda15f1d107a94654f448/testdata/errortests.dat.gz -------------------------------------------------------------------------------- /testdata/expected/0.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 0.csv 2 | [ 3 | [ 4 | 4 5 | <ABBA> 6 | 2 7 | no 8 | ] 9 | [ 10 | 38 11 | <Bach> 12 | 5 13 | no 14 | ] 15 | [ 16 | 39 17 | <Bartok> 18 | 5 19 | no 20 | ] 21 | [ 22 | 5 23 | <Beatles> 24 | 2 25 | no 26 | ] 27 | [ 28 | 40 29 | <Beethoven> 30 | 5 31 | no 32 | ] 33 | [ 34 | 6 35 | <Blondie> 36 | 2 37 | no 38 | ] 39 | [ 40 | 52 41 | <Bob Marley> 42 | 6 43 | yes 44 | ] 45 | [ 46 | 7 47 | <Bruce Springsteen> 48 | 2 49 | no 50 | ] 51 | [ 52 | 41 53 | <Chopin> 54 | 5 55 | yes 56 | ] 57 | [ 58 | 37 59 | <Classical & <Special>> 60 | 5 61 | no 62 | ] 63 | [ 64 | 8 65 | <David Bowie> 66 | 2 67 | no 68 | ] 69 | ] 70 | -------------------------------------------------------------------------------- /testdata/expected/1-2-csv.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 1.csv 2.csv 2 | =UXF_1 CID Name Selected 3 | =UXF_2 TID Artist CID Selected 4 | [ 5 | (UXF_1 6 | 5 <Classical> yes 7 | 4 <Modern Instrumental & <Experimental>> no 8 | 1 <New Acquistions> no 9 | 2 <Pop> no 10 | 3 <Punk> no 11 | 7 <Uncategorized> no 12 | 6 <Unpopular Pop> no 13 | ) 14 | (UXF_2 15 | 4 <ABBA> 2 no 16 | 38 <Bach> 5 no 17 | 39 <Bartok> 5 no 18 | 5 <Beatles> 2 no 19 | 40 <Beethoven> 5 no 20 | 6 <Blondie> 2 no 21 | 52 <Bob Marley> 6 yes 22 | 7 <Bruce Springsteen> 2 no 23 | 41 <Chopin> 5 yes 24 | 37 <Classical & <Special>> 5 no 25 | 8 <David Bowie> 2 no 26 | ) 27 | ] 28 | -------------------------------------------------------------------------------- /testdata/expected/1.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 1.csv 2 | =UXF_1 CID Name Selected 3 | (UXF_1 4 | 5 <Classical> yes 5 | 4 <Modern Instrumental & <Experimental>> no 6 | 1 <New Acquistions> no 7 | 2 <Pop> no 8 | 3 <Punk> no 9 | 7 <Uncategorized> no 10 | 6 <Unpopular Pop> no 11 | ) 12 | -------------------------------------------------------------------------------- /testdata/expected/2.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2.csv 2 | =UXF_1 TID Artist CID Selected 3 | (UXF_1 4 | 4 <ABBA> 2 no 5 | 38 <Bach> 5 no 6 | 39 <Bartok> 5 no 7 | 5 <Beatles> 2 no 8 | 40 <Beethoven> 5 no 9 | 6 <Blondie> 2 no 10 | 52 <Bob Marley> 6 yes 11 | 7 <Bruce Springsteen> 2 no 12 | 41 <Chopin> 5 yes 13 | 37 <Classical & <Special>> 5 no 14 | 8 <David Bowie> 2 no 15 | ) 16 | -------------------------------------------------------------------------------- /testdata/expected/big.uxd.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mark-summerfield/uxf/847bfe0ded4499bfbe8eda15f1d107a94654f448/testdata/expected/big.uxd.gz -------------------------------------------------------------------------------- /testdata/expected/e102-rs-win.txt: -------------------------------------------------------------------------------- 1 | The system cannot find the file specified. (os error 2) 2 | -------------------------------------------------------------------------------- /testdata/expected/e102-rs.txt: -------------------------------------------------------------------------------- 1 | No such file or directory (os error 2) 2 | -------------------------------------------------------------------------------- /testdata/expected/e102.txt: -------------------------------------------------------------------------------- 1 | uxf.py:error:uxf:F102:testdata/e102.missing:0:failed to read UXF text: [Errno 2] No such file or directory: 'testdata/e102.missing' 2 | -------------------------------------------------------------------------------- /testdata/expected/e110.txt: -------------------------------------------------------------------------------- 1 | uxf.py:error:uxf:F110:empty.uxe:1:missing UXF file header or empty file 2 | -------------------------------------------------------------------------------- /testdata/expected/e120.txt: -------------------------------------------------------------------------------- 1 | E120:/home/mark/app/uxf/testdata/e120.uxe:1:invalid UXF file header 2 | -------------------------------------------------------------------------------- /testdata/expected/e13.txt: -------------------------------------------------------------------------------- 1 | uxf:W422:t13.uxf:43:unused ttypes: 'IntPair' 'IPv4' 'Playlists' 'RGB' 'RGBA' 2 | -------------------------------------------------------------------------------- /testdata/expected/e130-rs.txt: -------------------------------------------------------------------------------- 1 | E131:/home/mark/app/uxf/testdata/e130.uxe:3:expected List, Map, or Table 2 | -------------------------------------------------------------------------------- /testdata/expected/e130.txt: -------------------------------------------------------------------------------- 1 | uxf:E402:e130.uxe:3:expected a map, list, or table, got 3:EOF 2 | -------------------------------------------------------------------------------- /testdata/expected/e14.txt: -------------------------------------------------------------------------------- 1 | uxf:W422:t14.uxf:39:unused ttypes: 'Categories' 'IntPair' 'IPv4' 'Playlists' 'RGB' 'RGBA' 2 | -------------------------------------------------------------------------------- /testdata/expected/e141.txt: -------------------------------------------------------------------------------- 1 | uxf:W141:e141.uxe:0:version 9 > current 1 2 | -------------------------------------------------------------------------------- /testdata/expected/e151.txt: -------------------------------------------------------------------------------- 1 | uxf:E151:e151.uxe:0:failed to read UXF file version number 2 | -------------------------------------------------------------------------------- /testdata/expected/e160-rs.txt: -------------------------------------------------------------------------------- 1 | E160:/home/mark/app/uxf/testdata/e160.uxe:2:invalid comment syntax: expected '<', got '[' 2 | -------------------------------------------------------------------------------- /testdata/expected/e160.txt: -------------------------------------------------------------------------------- 1 | uxf:E160:e160.uxe:2:invalid comment syntax: expected '<', got [ 2 | uxf:E272:e160.uxe:2:expected value got type, comment 3 | uxf:E272:e160.uxe:2:expected value got type, syntax 4 | uxf:E170:e160.uxe:2:invalid character encountered: '>' 5 | uxf:E446:e160.uxe:2:expected list vtype, got invalid 6 | uxf:E506:e160.uxe:3:expected invalid, got List [] 7 | -------------------------------------------------------------------------------- /testdata/expected/e170-rs.txt: -------------------------------------------------------------------------------- 1 | E170:/home/mark/app/uxf/testdata/e170.uxe:2:invalid character encountered, got '$' 2 | -------------------------------------------------------------------------------- /testdata/expected/e170.txt: -------------------------------------------------------------------------------- 1 | uxf:E170:e170.uxe:1:invalid character encountered: '$' 2 | -------------------------------------------------------------------------------- /testdata/expected/e180.txt: -------------------------------------------------------------------------------- 1 | E180:/home/mark/app/uxf/testdata/e190.uxe:2:a str must follow the # comment introducer, got '<' 2 | -------------------------------------------------------------------------------- /testdata/expected/e190.txt: -------------------------------------------------------------------------------- 1 | uxf:E190:e190.uxe:1:inline comments may only occur at the start of Lists, Maps, Tables, and TClasses 2 | -------------------------------------------------------------------------------- /testdata/expected/e195-rs.txt: -------------------------------------------------------------------------------- 1 | E195:/home/mark/app/uxf/testdata/e195.uxe:2:attempt to concatenate a str to a non-str or to a comment 2 | -------------------------------------------------------------------------------- /testdata/expected/e195.txt: -------------------------------------------------------------------------------- 1 | uxf:E195:e195.uxe:1:attempt to concatenate a str to a non-str 2 | -------------------------------------------------------------------------------- /testdata/expected/e200.txt: -------------------------------------------------------------------------------- 1 | uxf:E200:e200.uxe:1:expected bytes, got 'ABCDEFGH': non-hexadecimal number found in fromhex() arg at position 6 2 | -------------------------------------------------------------------------------- /testdata/expected/e210-rs.txt: -------------------------------------------------------------------------------- 1 | E210:/home/mark/app/uxf/testdata/e210.uxe:2:failed to parse "3e4e" as real: invalid float literal 2 | -------------------------------------------------------------------------------- /testdata/expected/e210.txt: -------------------------------------------------------------------------------- 1 | uxf:E210:e210.uxe:1:invalid number: '3e4e': could not convert string to float: '3e4e' 2 | -------------------------------------------------------------------------------- /testdata/expected/e240-rs.txt: -------------------------------------------------------------------------------- 1 | E240:/home/mark/app/uxf/testdata/e240.uxe:2:failed to parse "2021-11-05T4:" as datetime: trailing input 2 | -------------------------------------------------------------------------------- /testdata/expected/e240.txt: -------------------------------------------------------------------------------- 1 | uxf:E220:e240.uxe:1:invalid number or date/time: '2021-11-05T4:': Invalid isoformat string: '2021-11-05T4:' 2 | -------------------------------------------------------------------------------- /testdata/expected/e241-rs.txt: -------------------------------------------------------------------------------- 1 | E241:/home/mark/app/uxf/testdata/e241.uxe:2:failed to parse "2022-123-19" as date: input contains invalid characters 2 | -------------------------------------------------------------------------------- /testdata/expected/e241.txt: -------------------------------------------------------------------------------- 1 | uxf:E220:e241.uxe:1:invalid number or date/time: '2022-123-19': Invalid isoformat string: '2022-123-19' 2 | -------------------------------------------------------------------------------- /testdata/expected/e248-rs.txt: -------------------------------------------------------------------------------- 1 | E248:/home/mark/app/uxf/testdata/e248.uxe:2:expected field vtype, got "int" 2 | -------------------------------------------------------------------------------- /testdata/expected/e248.txt: -------------------------------------------------------------------------------- 1 | uxf:E248:e248.uxe:2:expected field vtype, got 'int' 2 | uxf:E446:e248.uxe:2:expected list vtype, got a 3 | -------------------------------------------------------------------------------- /testdata/expected/e260-rs.txt: -------------------------------------------------------------------------------- 1 | E260:/home/mark/app/uxf/testdata/e260.uxe:3:expected field vtype, got "(A 1)" 2 | -------------------------------------------------------------------------------- /testdata/expected/e260.txt: -------------------------------------------------------------------------------- 1 | uxf:E260:1.uxf:2:expected field vtype, got (A 1) 2 | -------------------------------------------------------------------------------- /testdata/expected/e269.txt: -------------------------------------------------------------------------------- 1 | E269:/home/mark/app/uxf/testdata/e269.uxe:2:unterminated bytes, got ']' 2 | -------------------------------------------------------------------------------- /testdata/expected/e270-rs.txt: -------------------------------------------------------------------------------- 1 | E270:/home/mark/app/uxf/testdata/e270.uxe:2:unterminated string 2 | -------------------------------------------------------------------------------- /testdata/expected/e270.txt: -------------------------------------------------------------------------------- 1 | uxf:E270:e270.uxe:2:unterminated string 2 | uxf:E446:e270.uxe:2:expected list vtype, got a 3 | -------------------------------------------------------------------------------- /testdata/expected/e273-rs.txt: -------------------------------------------------------------------------------- 1 | E273:/home/mark/app/uxf/testdata/e273.uxe:2:expected ktype, got <thing> 2 | -------------------------------------------------------------------------------- /testdata/expected/e273.txt: -------------------------------------------------------------------------------- 1 | uxf:E273:e273.uxe:2:expected ktype got, thing 2 | uxf:E308:e273.uxe:2:a ktype must be one of (bytes, date, datetime, int, str), got thing 3 | uxf:E448:e273.uxe:2:expected map ktype, got thing 4 | uxf.py:error:uxf:F308:-:0:a ktype must be one of (bytes, date, datetime, int, str), got thing 5 | -------------------------------------------------------------------------------- /testdata/expected/e28.txt: -------------------------------------------------------------------------------- 1 | W422:/home/mark/app/uxf/testdata/t28.uxf:39:unused ttypes: IntPair IPv4 Playlists RGB RGBA 2 | -------------------------------------------------------------------------------- /testdata/expected/e294-rs.txt: -------------------------------------------------------------------------------- 1 | E294:/home/mark/app/uxf/testdata/e294.uxe:2:can only convert bytes, date, datetime, int, str from Value to Key, got list 2 | -------------------------------------------------------------------------------- /testdata/expected/e294.txt: -------------------------------------------------------------------------------- 1 | uxf.py:error:uxf:F294:-:0:map keys may only be of type int, date, datetime, str, or bytes, got List [] 2 | -------------------------------------------------------------------------------- /testdata/expected/e308-rs.txt: -------------------------------------------------------------------------------- 1 | E308:/home/mark/app/uxf/testdata/e308.uxe:2:a ktype must be one of ["bytes", "date", "int", "str"], got bool 2 | -------------------------------------------------------------------------------- /testdata/expected/e308.txt: -------------------------------------------------------------------------------- 1 | uxf:E308:e308.uxe:2:a ktype must be one of (bytes, date, datetime, int, str), got bool 2 | uxf:E448:e308.uxe:2:expected map ktype, got bool 3 | uxf.py:error:uxf:F308:-:0:a ktype must be one of (bytes, date, datetime, int, str), got bool 4 | -------------------------------------------------------------------------------- /testdata/expected/e33-rs.txt: -------------------------------------------------------------------------------- 1 | E506:/home/mark/app/uxf/testdata/t33.uxf:11:expected map, got table of type Geometry 2 | -------------------------------------------------------------------------------- /testdata/expected/e33.txt: -------------------------------------------------------------------------------- 1 | uxf:E456:t33.uxf:11:expected table value of type map, got value of type Geometry 2 | uxf:E454:t33.uxf:11:expected table value of type map, got table of type Geometry 3 | -------------------------------------------------------------------------------- /testdata/expected/e334.txt: -------------------------------------------------------------------------------- 1 | E334:/home/mark/app/uxf/testdata/e334.uxe:3:can't append to a fieldless table 2 | -------------------------------------------------------------------------------- /testdata/expected/e402.txt: -------------------------------------------------------------------------------- 1 | uxf:E402:e402.uxe:2:expected a map, list, or table, got 2:INT=5 2 | uxf.py:error:uxf:F590:e402.uxe:2:invalid UXF data 3 | -------------------------------------------------------------------------------- /testdata/expected/e410-rs.txt: -------------------------------------------------------------------------------- 1 | E410:/home/mark/app/uxf/testdata/e410.uxe:2:unexpected token, got Type <int> 2 | -------------------------------------------------------------------------------- /testdata/expected/e410.txt: -------------------------------------------------------------------------------- 1 | uxf:E410:e410.uxe:2:unexpected token, got 2:TYPE='int' 2 | -------------------------------------------------------------------------------- /testdata/expected/e422.txt: -------------------------------------------------------------------------------- 1 | W422:/home/mark/app/uxf/testdata/e422.uxe:4:unused ttype: Pair 2 | -------------------------------------------------------------------------------- /testdata/expected/e446.txt: -------------------------------------------------------------------------------- 1 | uxf:E446:e446.uxe:1:expected list vtype, got thing 2 | -------------------------------------------------------------------------------- /testdata/expected/e450-rs.txt: -------------------------------------------------------------------------------- 1 | E450:/home/mark/app/uxf/testdata/e450.uxe:2:expected table ttype, got "EOF" 2 | -------------------------------------------------------------------------------- /testdata/expected/e450.txt: -------------------------------------------------------------------------------- 1 | uxf.py:error:uxf:F450:e450.uxe:1:expected table ttype 2 | -------------------------------------------------------------------------------- /testdata/expected/e450b-rs.txt: -------------------------------------------------------------------------------- 1 | E450:/home/mark/app/uxf/testdata/e450b.uxe:2:expected table ttype, got "Type <int>" 2 | -------------------------------------------------------------------------------- /testdata/expected/e450b.txt: -------------------------------------------------------------------------------- 1 | uxf.py:error:uxf:F450:e450b.uxe:1:expected table ttype, got int 2 | -------------------------------------------------------------------------------- /testdata/expected/e456-rs.txt: -------------------------------------------------------------------------------- 1 | E506:/home/mark/app/uxf/testdata/e456.uxe:4:expected A, got table of type B 2 | -------------------------------------------------------------------------------- /testdata/expected/e456.txt: -------------------------------------------------------------------------------- 1 | E456:/home/mark/app/uxf/testdata/e456.uxe:4:expected table value of type A, got value of type B 2 | -------------------------------------------------------------------------------- /testdata/expected/e500-rs.txt: -------------------------------------------------------------------------------- 1 | E500:/home/mark/app/uxf/testdata/e500.uxe:4:expected b, got 2 2 | -------------------------------------------------------------------------------- /testdata/expected/e500.txt: -------------------------------------------------------------------------------- 1 | uxf:E500:e500.uxe:3:expected b, got int 2 2 | -------------------------------------------------------------------------------- /testdata/expected/e506-rs.txt: -------------------------------------------------------------------------------- 1 | E506:/home/mark/app/uxf/testdata/e506.uxe:2:expected int, got map 2 | -------------------------------------------------------------------------------- /testdata/expected/e506.txt: -------------------------------------------------------------------------------- 1 | uxf:E506:e506.uxe:1:expected int, got Map {} 2 | -------------------------------------------------------------------------------- /testdata/expected/e523-rs.txt: -------------------------------------------------------------------------------- 1 | E523:/home/mark/app/uxf/testdata/e523.uxe:2:invalid or missing ttype name 2 | -------------------------------------------------------------------------------- /testdata/expected/e523.txt: -------------------------------------------------------------------------------- 1 | uxf.py:error:uxf:F526:e523.uxe:3:TClass without ttype 2 | -------------------------------------------------------------------------------- /testdata/expected/e54.txt: -------------------------------------------------------------------------------- 1 | uxf:W422:t54.uxf:4:unused ttype: 'Pair' 2 | -------------------------------------------------------------------------------- /testdata/expected/e55.txt: -------------------------------------------------------------------------------- 1 | uxf:W422:t55.uxf:4:unused ttype: 'Pair' 2 | -------------------------------------------------------------------------------- /testdata/expected/e550.txt: -------------------------------------------------------------------------------- 1 | uxf:E550:e550.uxe:2:failed to import 'http://localhost:5558/missing.uxi': HTTP Error 404: File not found 2 | -------------------------------------------------------------------------------- /testdata/expected/e56-rs.txt: -------------------------------------------------------------------------------- 1 | R486:/home/mark/app/uxf/testdata/l56.uxf:9:converted str <2> to int 2 2 | R486:/home/mark/app/uxf/testdata/l56.uxf:9:converted str <1983-04-07> to date 1983-04-07 3 | R486:/home/mark/app/uxf/testdata/l56.uxf:11:converted real 7.2 to int 7 4 | E488:/home/mark/app/uxf/testdata/l56.uxf:15:expected real, got <wrong> 5 | -------------------------------------------------------------------------------- /testdata/expected/e56.txt: -------------------------------------------------------------------------------- 1 | uxf:R486:l56.uxf:9:converted str '2' to int 2 2 | uxf:R486:l56.uxf:9:converted str '1983-04-07' to date 1983-04-07 3 | uxf:R498:l56.uxf:11:converted real 7.2 to int 7 4 | uxf:E488:l56.uxf:15:expected real, got str wrong 5 | uxf:R496:l56.uxf:18:converted int 4 to real 4.0 6 | uxf:R486:l56.uxf:20:converted str '6.7' to real 6.7 7 | uxf:R486:l56.uxf:21:converted str '9' to real 9 8 | uxf:R496:l56.uxf:22:converted int -8 to real -8.0 9 | uxf:R496:l56.uxf:23:converted int 11 to real 11.0 10 | uxf:R496:l56.uxf:24:converted int False to real 0.0 11 | uxf:R496:l56.uxf:25:converted int True to real 1.0 12 | uxf:R486:l56.uxf:25:converted str '2008-09-01T23:59:46' to datetime 2008-09-01T23:59:46 13 | -------------------------------------------------------------------------------- /testdata/expected/e560.txt: -------------------------------------------------------------------------------- 1 | uxf:E560:e560.uxe:2:there is no system ttype import called 'absent' 2 | -------------------------------------------------------------------------------- /testdata/expected/e57-rs.txt: -------------------------------------------------------------------------------- 1 | E488:/home/mark/app/uxf/testdata/l57.uxf:15:expected real, got <wrong> 2 | -------------------------------------------------------------------------------- /testdata/expected/e57.txt: -------------------------------------------------------------------------------- 1 | uxf:E488:l57.uxf:15:expected real, got str wrong 2 | uxf:R496:l57.uxf:21:converted int 9 to real 9.0 3 | -------------------------------------------------------------------------------- /testdata/expected/e58-rs.txt: -------------------------------------------------------------------------------- 1 | R486:/home/mark/app/uxf/testdata/l58.uxf:13:converted str <yes> to bool yes 2 | R486:/home/mark/app/uxf/testdata/l58.uxf:13:converted str <no> to bool no 3 | R486:/home/mark/app/uxf/testdata/l58.uxf:13:converted str <t> to bool yes 4 | R486:/home/mark/app/uxf/testdata/l58.uxf:13:converted str <f> to bool no 5 | R486:/home/mark/app/uxf/testdata/l58.uxf:13:converted str <true> to bool yes 6 | R486:/home/mark/app/uxf/testdata/l58.uxf:13:converted str <false> to bool no 7 | E488:/home/mark/app/uxf/testdata/l58.uxf:13:expected bool, got <duh> 8 | -------------------------------------------------------------------------------- /testdata/expected/e59.txt: -------------------------------------------------------------------------------- 1 | uxf:W422:l59.uxf:20:unused ttypes: 'one' 'three' 'two' 2 | -------------------------------------------------------------------------------- /testdata/expected/e60-rs.txt: -------------------------------------------------------------------------------- 1 | R486:/home/mark/app/uxf/testdata/l60.uxf:5:converted real 9.0 to int 9 2 | R486:/home/mark/app/uxf/testdata/l60.uxf:5:converted real 10.1 to int 10 3 | R486:/home/mark/app/uxf/testdata/l60.uxf:6:converted str <-1> to int -1 4 | R486:/home/mark/app/uxf/testdata/l60.uxf:6:converted str <13> to int 13 5 | -------------------------------------------------------------------------------- /testdata/expected/e60.txt: -------------------------------------------------------------------------------- 1 | uxf:R498:l60.uxf:5:converted real 9.0 to int 9 2 | uxf:R498:l60.uxf:5:converted real 10.1 to int 10 3 | uxf:R486:l60.uxf:6:converted str '-1' to int -1 4 | uxf:R486:l60.uxf:6:converted str '13' to int 13 5 | -------------------------------------------------------------------------------- /testdata/expected/e601.txt: -------------------------------------------------------------------------------- 1 | E601:/home/mark/app/uxf/testdata/e200.uxe:2:invalid bytes: invalid hex char: 'G' 2 | -------------------------------------------------------------------------------- /testdata/expected/e601b.txt: -------------------------------------------------------------------------------- 1 | E601:/home/mark/app/uxf/testdata/e601.uxe:2:invalid bytes: odd number of hex chars, unpaired: 'f' 2 | -------------------------------------------------------------------------------- /testdata/expected/e62.txt: -------------------------------------------------------------------------------- 1 | uxf:ttype-test.uxi:7:#422:unused utypes: 'IPv4', 'pair', 'rgb', 'rgba' 2 | -------------------------------------------------------------------------------- /testdata/expected/e63.txt: -------------------------------------------------------------------------------- 1 | uxf:W422:t63.uxf:14:unused ttype: 'dob' 2 | -------------------------------------------------------------------------------- /testdata/expected/e63r.txt: -------------------------------------------------------------------------------- 1 | uxf:W422:t63r.uxf:29:unused ttype: 'dob' 2 | -------------------------------------------------------------------------------- /testdata/expected/e64-rs.txt: -------------------------------------------------------------------------------- 1 | E176:/home/mark/app/uxf/testdata/i64.uxi:2:a UXF file cannot import itself 2 | -------------------------------------------------------------------------------- /testdata/expected/e64.txt: -------------------------------------------------------------------------------- 1 | uxf.py:error:uxf:F176:i64.uxi:1:a UXF file cannot import itself 2 | -------------------------------------------------------------------------------- /testdata/expected/e65-rs.txt: -------------------------------------------------------------------------------- 1 | E580:/home/mark/app/uxf/testdata/i65.uxi:2:cannot do circular imports "/home/mark/app/uxf/testdata/i66.uxi" 2 | -------------------------------------------------------------------------------- /testdata/expected/e65.txt: -------------------------------------------------------------------------------- 1 | uxf.py:error:uxf:F580:i65.uxi:1:cannot do circular imports '/home/mark/app/uxf/testdata/i66.uxi' 2 | -------------------------------------------------------------------------------- /testdata/expected/e66-rs.txt: -------------------------------------------------------------------------------- 1 | E580:/home/mark/app/uxf/testdata/i66.uxi:2:cannot do circular imports "/home/mark/app/uxf/testdata/i65.uxi" 2 | -------------------------------------------------------------------------------- /testdata/expected/e66.txt: -------------------------------------------------------------------------------- 1 | uxf.py:error:uxf:F580:i66.uxi:1:cannot do circular imports '/home/mark/app/uxf/testdata/i65.uxi' 2 | -------------------------------------------------------------------------------- /testdata/expected/e67.txt: -------------------------------------------------------------------------------- 1 | W422:/home/mark/app/uxf/testdata/i67.uxi:11:unused ttype: dob 2 | -------------------------------------------------------------------------------- /testdata/expected/e69.txt: -------------------------------------------------------------------------------- 1 | W422:/home/mark/app/uxf/testdata/i69.uxi:10:unused ttypes: dob point3d 2 | -------------------------------------------------------------------------------- /testdata/expected/e72.txt: -------------------------------------------------------------------------------- 1 | W422:/home/mark/app/uxf/testdata/t72.uxi:12:unused ttypes: dob point3d 2 | -------------------------------------------------------------------------------- /testdata/expected/e86-rs.txt: -------------------------------------------------------------------------------- 1 | E195:/home/mark/app/uxf/testdata/l86.uxf:6:attempt to concatenate a str to a non-str or to a comment 2 | -------------------------------------------------------------------------------- /testdata/expected/e86.txt: -------------------------------------------------------------------------------- 1 | uxf:W191:l86.uxf:5:for concatenated comments, the comment marker (#) should only precede the first fragment 2 | uxf:E190:l86.uxf:6:inline comments may only occur at the start of Lists, Maps, Tables, and TClasses 3 | -------------------------------------------------------------------------------- /testdata/expected/e87-rs-win.txt: -------------------------------------------------------------------------------- 1 | E586:\\?\UNC\VBOXSVR\app\uxf\testdata\e87.uxi:3:failed to import ".\\missing.uxi" 2 | -------------------------------------------------------------------------------- /testdata/expected/e87-rs.txt: -------------------------------------------------------------------------------- 1 | E586:/home/mark/app/uxf/testdata/e87.uxi:3:failed to import "./missing.uxi" 2 | -------------------------------------------------------------------------------- /testdata/expected/e87.txt: -------------------------------------------------------------------------------- 1 | uxf:E586:e87.uxi:2:failed to import '/home/mark/app/uxf/testdata/missing.uxi': uxf:F102:e87.uxi:0:failed to read UXF text: [Errno 2] No such file or directory: '/home/mark/app/uxf/testdata/missing.uxi' 2 | -------------------------------------------------------------------------------- /testdata/expected/e88-rs.txt: -------------------------------------------------------------------------------- 1 | E586:/home/mark/app/uxf/testdata/e88.uxi:3:failed to import "/home/mark/app/uxf/testdata/e87.uxi" 2 | -------------------------------------------------------------------------------- /testdata/expected/e88.txt: -------------------------------------------------------------------------------- 1 | uxf:E586:e87.uxi:2:failed to import '/home/mark/app/uxf/testdata/missing.uxi': uxf:F102:e87.uxi:0:failed to read UXF text: [Errno 2] No such file or directory: '/home/mark/app/uxf/testdata/missing.uxi' 2 | -------------------------------------------------------------------------------- /testdata/expected/e89-rs.txt: -------------------------------------------------------------------------------- 1 | E530:/home/mark/app/uxf/testdata/e89.uxi:3:failed to import "http://localhost:5558/missing.uxf": E130:http://localhost:5558/missing.uxf:1:not a UXF file 2 | -------------------------------------------------------------------------------- /testdata/expected/e89.txt: -------------------------------------------------------------------------------- 1 | uxf:E550:e89.uxi:2:failed to import 'http://localhost:5558/missing.uxf': HTTP Error 404: File not found 2 | -------------------------------------------------------------------------------- /testdata/expected/empty.txt: -------------------------------------------------------------------------------- 1 | E953:/home/mark/app/uxf/testdata/empty.uxe:0:failed to read start: failed to fill whole buffer 2 | -------------------------------------------------------------------------------- /testdata/expected/epair1.txt: -------------------------------------------------------------------------------- 1 | uxf:W422:pair1.uxt:4:unused ttypes: 'Fraction' 'pair' 2 | -------------------------------------------------------------------------------- /testdata/expected/epair2.txt: -------------------------------------------------------------------------------- 1 | W422:/home/mark/app/uxf/testdata/pair2.uxt:3:unused ttype: pair 2 | -------------------------------------------------------------------------------- /testdata/expected/epairimportc-rs.txt: -------------------------------------------------------------------------------- 1 | E544:/home/mark/app/uxf/testdata/pairimportc.uxi:2:conflicting ttype definitions for pair 2 | -------------------------------------------------------------------------------- /testdata/expected/epairimportc.txt: -------------------------------------------------------------------------------- 1 | uxf.py:error:uxf:F544:pairimportc.uxi:1:conflicting ttype definitions for pair 2 | -------------------------------------------------------------------------------- /testdata/expected/i67.uxf.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mark-summerfield/uxf/847bfe0ded4499bfbe8eda15f1d107a94654f448/testdata/expected/i67.uxf.gz -------------------------------------------------------------------------------- /testdata/expected/i67c.uxf.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mark-summerfield/uxf/847bfe0ded4499bfbe8eda15f1d107a94654f448/testdata/expected/i67c.uxf.gz -------------------------------------------------------------------------------- /testdata/expected/i68.uxi: -------------------------------------------------------------------------------- 1 | uxf 1 UXF Include 2 | =include filename:str 3 | (include 4 | <t15.uxf> 5 | <t16.uxf> 6 | <t19.uxf> 7 | <t47.uxf> 8 | <t63.uxf> 9 | ) 10 | -------------------------------------------------------------------------------- /testdata/expected/i68inc.uxf.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mark-summerfield/uxf/847bfe0ded4499bfbe8eda15f1d107a94654f448/testdata/expected/i68inc.uxf.gz -------------------------------------------------------------------------------- /testdata/expected/i69.uxi: -------------------------------------------------------------------------------- 1 | uxf 1 2 | !http://localhost:5558/ttype-eg.uxf 3 | !ttype-test.uxi 4 | !t63.uxt 5 | =dob dob:date 6 | =point3d x:int y:int z:int 7 | [ 8 | (img (rgb 0 0 127) (:DECADE:)) 9 | (i <is this oblique?>) 10 | {30 (pair <one> 2)} 11 | ] 12 | -------------------------------------------------------------------------------- /testdata/expected/ini.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 ini.ini 2 | { 3 | <appearance> { 4 | <accuracy> 100 5 | <new-renderer> no 6 | <square-size> 10 7 | } 8 | <colors> { 9 | <change-bar> <#F00> 10 | <delete> <#F00> 11 | <exclusion-line> <#A42929> 12 | <highlight> <#FF0> 13 | <insert> <#0FF> 14 | <replace> <#F0F> 15 | } 16 | <corners> { 17 | <bottom-left> <0,0> 18 | <bottom-right> <0,0> 19 | <top-left> <0,0> 20 | <top-right> <0,0> 21 | } 22 | <general> { 23 | <highlight-transparency> 80 24 | <maxdirdepth> 1000 25 | <mode> <words> 26 | } 27 | <margins> { 28 | <bottom> 0 29 | <left> 0 30 | <right> 0 31 | <top> 0 32 | } 33 | <report> { 34 | <compact> no 35 | <decimals> 2 36 | <format> <> 37 | <output> <both> 38 | <path> <> 39 | <path-in-title> yes 40 | <scale> 100 41 | <show-field-content> no 42 | } 43 | <text> { 44 | <algorithm> <standard> 45 | <bar> yes 46 | <column-tolerance> 108 47 | <ignore-hyphens> no 48 | <line-tolerance> 10 49 | <normalize-hyphens> yes 50 | <normalize-ligatures> no 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /testdata/expected/l56.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | =Categories CID:int title:str selected:bool when:date 3 | =Playlists PID:int title cid:int selected:real timestamp:datetime 4 | [ 5 | (Categories 6 | 5 <Classical> yes 2001-12-27 7 | 4 <Modern Instrumental> no 1973-10-18 8 | 1 <New Acquistions> no 2019-02-10 9 | 2 <Pop> no 1983-04-07 10 | 3 <Punk> no 1999-06-09 11 | 7 <Uncategorized> no 1992-02-24 12 | 6 <Unpopular Pop> no 2004-04-11 13 | ) 14 | (Playlists 15 | 4 <ABBA> 2 <wrong> 1998-09-19T23:57:59 16 | 38 <Bach> 5 2.0 1982-07-12T23:57:12 17 | 39 <Bartok> 5 -3.0 1983-04-13T23:46:31 18 | 5 <Beatles> 2 4.0 2022-04-11T23:48:01 19 | 40 <Beethoven> 5 ? 1986-06-11T23:47:25 20 | 6 <Blondie> 2 6.7 1995-11-23T23:56:03 21 | 52 <Bob Marley> 6 9 1981-02-27T23:56:53 22 | 7 <Bruce Springsteen> 2 -8.0 1995-08-10T23:56:32 23 | 41 <Chopin> 5 11.0 1973-11-23T23:53:54 24 | 37 <Classical> 5 0.0 1992-11-18T23:57:27 25 | 8 <David Bowie> 2 1.0 2008-09-01T23:59:46 26 | ) 27 | ] 28 | -------------------------------------------------------------------------------- /testdata/expected/l56c.uxf.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mark-summerfield/uxf/847bfe0ded4499bfbe8eda15f1d107a94654f448/testdata/expected/l56c.uxf.gz -------------------------------------------------------------------------------- /testdata/expected/l57.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | =Categories CID:int title:str selected:bool when:date 3 | =Playlists PID:int title cid:int selected:real timestamp:datetime 4 | [ 5 | (Categories 6 | 5 <Classical> yes 2001-12-27 7 | 4 <Modern Instrumental> no 1973-10-18 8 | 1 <New Acquistions> no 2019-02-10 9 | 2 <Pop> no 1983-04-07 10 | 3 <Punk> no 1999-06-09 11 | 7 <Uncategorized> no 1992-02-24 12 | 6 <Unpopular Pop> no 2004-04-11 13 | ) 14 | (Playlists 15 | 4 <ABBA> 2 <wrong> 1998-09-19T23:57:59 16 | 38 <Bach> 5 2.0 1982-07-12T23:57:12 17 | 39 <Bartok> 5 -3.0 1983-04-13T23:46:31 18 | 5 <Beatles> 2 4.0 2022-04-11T23:48:01 19 | 40 <Beethoven> 5 ? 1986-06-11T23:47:25 20 | 6 <Blondie> 2 6.7 1995-11-23T23:56:03 21 | 52 <Bob Marley> 6 9.0 1981-02-27T23:56:53 22 | 7 <Bruce Springsteen> 2 -8.0 1995-08-10T23:56:32 23 | 41 <Chopin> 5 11.0 1973-11-23T23:53:54 24 | 37 <Classical> 5 0.0 1992-11-18T23:57:27 25 | 8 <David Bowie> 2 1.0 2008-09-01T23:59:46 26 | ) 27 | ] 28 | -------------------------------------------------------------------------------- /testdata/expected/l59.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | =one x 3 | =p a:int b:int 4 | =three x y z 5 | =two x y 6 | { 7 | <x> {int str 8 | 1 <one> 9 | 2 <two> 10 | } 11 | <y> {int p 12 | 3 (p 4 5) 13 | 6 (p 7 8) 14 | 9 (p 10 11) 15 | } 16 | <z> {#<map z> int p 17 | 3 (p 4 5) 18 | 6 (p 7 8) 19 | 9 (p 10 11) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /testdata/expected/l60.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | =p x:int y:int 3 | {str p 4 | <four> (#<ok2> p -7 -6) 5 | <one> (#<ok> p 6 | 1 2 7 | -3 4 8 | 5 6 9 | ) 10 | <three> (#<worse> p 11 | 11 -12 12 | -1 13 13 | ) 14 | <two> (#<bad> p 15 | 7 -8 16 | 9 10 17 | ) 18 | } 19 | -------------------------------------------------------------------------------- /testdata/expected/l86.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | #<A file level comment in two parts> 3 | [#<A list comment in 2 parts> 4 | <A string in II parts> 5 | [#<Another list comment in ii parts>] 6 | <Another string in deux parts> 7 | ] 8 | -------------------------------------------------------------------------------- /testdata/expected/m1.uxf.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mark-summerfield/uxf/847bfe0ded4499bfbe8eda15f1d107a94654f448/testdata/expected/m1.uxf.gz -------------------------------------------------------------------------------- /testdata/expected/m2.uxf.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mark-summerfield/uxf/847bfe0ded4499bfbe8eda15f1d107a94654f448/testdata/expected/m2.uxf.gz -------------------------------------------------------------------------------- /testdata/expected/pair1.uxt: -------------------------------------------------------------------------------- 1 | uxf 1 2 | =Fraction numerator:int denominator:int 3 | =pair first second 4 | [] 5 | -------------------------------------------------------------------------------- /testdata/expected/pair2.uxt: -------------------------------------------------------------------------------- 1 | uxf 1 2 | =pair x:int y:int 3 | {} 4 | -------------------------------------------------------------------------------- /testdata/expected/pairimportd.uxi: -------------------------------------------------------------------------------- 1 | uxf 1 2 | !pair1.uxt 3 | [ 4 | (pair) 5 | (Fraction) 6 | ] 7 | -------------------------------------------------------------------------------- /testdata/expected/t0.json: -------------------------------------------------------------------------------- 1 | { 2 | "UXF^custom": "EPD (simple dict of lists)", 3 | "UXF^data": { 4 | "Classical": [ 5 | 5, 6 | true 7 | ], 8 | "Modern Instrumental": [ 9 | 4, 10 | false 11 | ], 12 | "New Acquistions": [ 13 | 1, 14 | false 15 | ] 16 | } 17 | } -------------------------------------------------------------------------------- /testdata/expected/t0.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 EPD (simple dict of lists) 2 | { 3 | <Classical> [ 4 | 5 5 | yes 6 | ] 7 | <Modern Instrumental> [ 8 | 4 9 | no 10 | ] 11 | <New Acquistions> [ 12 | 1 13 | no 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /testdata/expected/t0.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" ?> 2 | <uxf version="1" custom="EPD (simple dict of lists)"> 3 | <map> 4 | <key> 5 | <str>Classical</str> 6 | </key> 7 | <value> 8 | <list> 9 | <int v="5"/> 10 | <yes/> 11 | </list> 12 | </value> 13 | <key> 14 | <str>Modern Instrumental</str> 15 | </key> 16 | <value> 17 | <list> 18 | <int v="4"/> 19 | <no/> 20 | </list> 21 | </value> 22 | <key> 23 | <str>New Acquistions</str> 24 | </key> 25 | <value> 26 | <list> 27 | <int v="1"/> 28 | <no/> 29 | </list> 30 | </value> 31 | </map> 32 | </uxf> 33 | -------------------------------------------------------------------------------- /testdata/expected/t0c.uxf.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mark-summerfield/uxf/847bfe0ded4499bfbe8eda15f1d107a94654f448/testdata/expected/t0c.uxf.gz -------------------------------------------------------------------------------- /testdata/expected/t1.csv: -------------------------------------------------------------------------------- 1 | 5,"Classical",True,"1999-07-21" 2 | 4,"Modern Instrumental",False,"1976-11-30" 3 | 1,"New Acquistions",False,"1947-02-28" 4 | -------------------------------------------------------------------------------- /testdata/expected/t1.json: -------------------------------------------------------------------------------- 1 | { 2 | "UXF^custom": "EPD (simple list of lists)", 3 | "UXF^data": [ 4 | [ 5 | 5, 6 | "Classical", 7 | true, 8 | { 9 | "UXF^date": "1999-07-21" 10 | } 11 | ], 12 | [ 13 | 4, 14 | "Modern Instrumental", 15 | false, 16 | { 17 | "UXF^date": "1976-11-30" 18 | } 19 | ], 20 | [ 21 | 1, 22 | "New Acquistions", 23 | false, 24 | { 25 | "UXF^date": "1947-02-28" 26 | } 27 | ] 28 | ] 29 | } -------------------------------------------------------------------------------- /testdata/expected/t1.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 EPD (simple list of lists) 2 | [ 3 | [ 4 | 5 5 | <Classical> 6 | yes 7 | 1999-07-21 8 | ] 9 | [ 10 | 4 11 | <Modern Instrumental> 12 | no 13 | 1976-11-30 14 | ] 15 | [ 16 | 1 17 | <New Acquistions> 18 | no 19 | 1947-02-28 20 | ] 21 | ] 22 | -------------------------------------------------------------------------------- /testdata/expected/t1.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" ?> 2 | <uxf version="1" custom="EPD (simple list of lists)"> 3 | <list> 4 | <list> 5 | <int v="5"/> 6 | <str>Classical</str> 7 | <yes/> 8 | <date v="1999-07-21"/> 9 | </list> 10 | <list> 11 | <int v="4"/> 12 | <str>Modern Instrumental</str> 13 | <no/> 14 | <date v="1976-11-30"/> 15 | </list> 16 | <list> 17 | <int v="1"/> 18 | <str>New Acquistions</str> 19 | <no/> 20 | <date v="1947-02-28"/> 21 | </list> 22 | </list> 23 | </uxf> 24 | -------------------------------------------------------------------------------- /testdata/expected/t10c.uxf.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mark-summerfield/uxf/847bfe0ded4499bfbe8eda15f1d107a94654f448/testdata/expected/t10c.uxf.gz -------------------------------------------------------------------------------- /testdata/expected/t11c.uxf.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mark-summerfield/uxf/847bfe0ded4499bfbe8eda15f1d107a94654f448/testdata/expected/t11c.uxf.gz -------------------------------------------------------------------------------- /testdata/expected/t12c.uxf.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mark-summerfield/uxf/847bfe0ded4499bfbe8eda15f1d107a94654f448/testdata/expected/t12c.uxf.gz -------------------------------------------------------------------------------- /testdata/expected/t15.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 Test (list of tables with dates and datetimes) 2 | #<Suitable for SQLite conversion> 3 | =Categories CID Title Selected Date:date 4 | =Playlists PID Title Cid Selected DateTime:datetime 5 | [ 6 | (Categories 7 | 5 <Classical> yes 2001-12-27 8 | 4 <Modern Instrumental> no 1973-10-18 9 | 1 <New Acquistions> no 2019-02-10 10 | 2 <Pop> no 1983-04-07 11 | 3 <Punk> no 1999-06-09 12 | 7 <Uncategorized> no 1992-02-24 13 | 6 <Unpopular Pop> no 2004-04-11 14 | ) 15 | (Playlists 16 | 4 <ABBA> 2 no 1998-09-19T23:57:59 17 | 38 <Bach> 5 no 1982-07-12T23:57:12 18 | 39 <Bartok> 5 no 1983-04-13T23:46:31 19 | 5 <Beatles> 2 no 2022-04-11T23:48:01 20 | 40 <Beethoven> 5 no 1986-06-11T23:47:25 21 | 6 <Blondie> 2 no 1995-11-23T23:56:03 22 | 52 <Bob Marley> 6 yes 1981-02-27T23:56:53 23 | 7 <Bruce Springsteen> 2 no 1995-08-10T23:56:32 24 | 41 <Chopin> 5 yes 1973-11-23T23:53:54 25 | 37 <Classical> 5 no 1992-11-18T23:57:27 26 | 8 <David Bowie> 2 no 2008-09-01T23:59:46 27 | ) 28 | ] 29 | -------------------------------------------------------------------------------- /testdata/expected/t16.json: -------------------------------------------------------------------------------- 1 | { 2 | "UXF^custom": "One Column Table", 3 | "UXF^ttypes": [ 4 | { 5 | "UXF^ttype": { 6 | "name": "Countries", 7 | "fields": { 8 | "Name": null 9 | } 10 | } 11 | } 12 | ], 13 | "UXF^data": { 14 | "UXF^table": { 15 | "name": "Countries", 16 | "comment": null, 17 | "fields": { 18 | "Name": null 19 | }, 20 | "records": [ 21 | [ 22 | "Netherlands" 23 | ], 24 | [ 25 | "Wales" 26 | ], 27 | [ 28 | "Belgium" 29 | ], 30 | [ 31 | "Australia" 32 | ], 33 | [ 34 | "Japan" 35 | ], 36 | [ 37 | "Ukraine" 38 | ] 39 | ] 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /testdata/expected/t16.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 One Column Table 2 | =Countries Name 3 | (Countries 4 | <Netherlands> 5 | <Wales> 6 | <Belgium> 7 | <Australia> 8 | <Japan> 9 | <Ukraine> 10 | ) 11 | -------------------------------------------------------------------------------- /testdata/expected/t16.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" ?> 2 | <uxf version="1" custom="One Column Table"> 3 | <ttypes> 4 | <ttype name="Countries"> 5 | <field name="Name"/> 6 | </ttype> 7 | </ttypes> 8 | <table name="Countries"> 9 | <row> 10 | <str>Netherlands</str> 11 | </row> 12 | <row> 13 | <str>Wales</str> 14 | </row> 15 | <row> 16 | <str>Belgium</str> 17 | </row> 18 | <row> 19 | <str>Australia</str> 20 | </row> 21 | <row> 22 | <str>Japan</str> 23 | </row> 24 | <row> 25 | <str>Ukraine</str> 26 | </row> 27 | </table> 28 | </uxf> 29 | -------------------------------------------------------------------------------- /testdata/expected/t17.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | =Categories CID Title Selected 3 | =Playlists PID:int Title:str CID:int Selected:bool 4 | [ 5 | (Categories 6 | 5 <Classical> yes 7 | 4 <Modern Instrumental> no 8 | 1 <New Acquistions> no 9 | 2 <Pop> no 10 | 3 <Punk> no 11 | 7 <Uncategorized> no 12 | 6 <Unpopular Pop> no 13 | ) 14 | (Playlists 15 | 4 <ABBA> 2 no 16 | 38 <Bach> 5 no 17 | 39 <Bartok> 5 no 18 | 5 <Beatles> 2 no 19 | 40 <Beethoven> 5 no 20 | 6 <Blondie> 2 no 21 | 52 <Bob Marley> 6 yes 22 | 7 <Bruce Springsteen> 2 no 23 | 41 <Chopin> 5 yes 24 | 37 <Classical> 5 no 25 | 8 <David Bowie> 2 no 26 | 9 <Dire Straits> 2 no 27 | ) 28 | ] 29 | -------------------------------------------------------------------------------- /testdata/expected/t18.json: -------------------------------------------------------------------------------- 1 | { 2 | "UXF^data": [ 3 | [ 4 | "Price List", 5 | "Date", 6 | "Price", 7 | "Quantity", 8 | "ID", 9 | "Description" 10 | ], 11 | [ 12 | { 13 | "UXF^date": "2022-09-21" 14 | }, 15 | 3.99, 16 | 2, 17 | "CH1-A2", 18 | "Chisels (pair), 1in & 1\u00bcin" 19 | ], 20 | [ 21 | { 22 | "UXF^date": "2022-10-02" 23 | }, 24 | 4.49, 25 | 1, 26 | "HV2-K9", 27 | "Hammer, 2lb" 28 | ], 29 | [ 30 | { 31 | "UXF^date": "2022-10-02" 32 | }, 33 | 5.89, 34 | 1, 35 | "SX4-D1", 36 | "Eversure Sealant, 13-floz" 37 | ] 38 | ] 39 | } -------------------------------------------------------------------------------- /testdata/expected/t18.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | [ 3 | [ 4 | <Price List> 5 | <Date> 6 | <Price> 7 | <Quantity> 8 | <ID> 9 | <Description> 10 | ] 11 | [ 12 | 2022-09-21 13 | 3.99 14 | 2 15 | <CH1-A2> 16 | <Chisels (pair), 1in & 1¼in> 17 | ] 18 | [ 19 | 2022-10-02 20 | 4.49 21 | 1 22 | <HV2-K9> 23 | <Hammer, 2lb> 24 | ] 25 | [ 26 | 2022-10-02 27 | 5.89 28 | 1 29 | <SX4-D1> 30 | <Eversure Sealant, 13-floz> 31 | ] 32 | ] 33 | -------------------------------------------------------------------------------- /testdata/expected/t18.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" ?> 2 | <uxf version="1"> 3 | <list> 4 | <list> 5 | <str>Price List</str> 6 | <str>Date</str> 7 | <str>Price</str> 8 | <str>Quantity</str> 9 | <str>ID</str> 10 | <str>Description</str> 11 | </list> 12 | <list> 13 | <date v="2022-09-21"/> 14 | <real v="3.99"/> 15 | <int v="2"/> 16 | <str>CH1-A2</str> 17 | <str>Chisels (pair), 1in & 1¼in</str> 18 | </list> 19 | <list> 20 | <date v="2022-10-02"/> 21 | <real v="4.49"/> 22 | <int v="1"/> 23 | <str>HV2-K9</str> 24 | <str>Hammer, 2lb</str> 25 | </list> 26 | <list> 27 | <date v="2022-10-02"/> 28 | <real v="5.89"/> 29 | <int v="1"/> 30 | <str>SX4-D1</str> 31 | <str>Eversure Sealant, 13-floz</str> 32 | </list> 33 | </list> 34 | </uxf> 35 | -------------------------------------------------------------------------------- /testdata/expected/t19.json: -------------------------------------------------------------------------------- 1 | { 2 | "UXF^comment": "Suitable for SQLite conversion", 3 | "UXF^ttypes": [ 4 | { 5 | "UXF^ttype": { 6 | "name": "PriceList", 7 | "fields": { 8 | "Date": null, 9 | "Price": null, 10 | "Quantity": null, 11 | "ID": null, 12 | "Description": null 13 | } 14 | } 15 | } 16 | ], 17 | "UXF^data": { 18 | "UXF^table": { 19 | "name": "PriceList", 20 | "comment": null, 21 | "fields": { 22 | "Date": null, 23 | "Price": null, 24 | "Quantity": null, 25 | "ID": null, 26 | "Description": null 27 | }, 28 | "records": [ 29 | [ 30 | { 31 | "UXF^date": "2022-09-21" 32 | }, 33 | 3.99, 34 | 2, 35 | "CH1-A2", 36 | "Chisels (pair), 1in & 1\u00bcin" 37 | ], 38 | [ 39 | { 40 | "UXF^date": "2022-10-02" 41 | }, 42 | 4.49, 43 | 1, 44 | "HV2-K9", 45 | "Hammer, 2lb" 46 | ], 47 | [ 48 | { 49 | "UXF^date": "2022-10-02" 50 | }, 51 | 10.0, 52 | 1, 53 | "SX4-D1", 54 | "Eversure Sealant, 13-floz" 55 | ] 56 | ] 57 | } 58 | } 59 | } -------------------------------------------------------------------------------- /testdata/expected/t19.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | #<Suitable for SQLite conversion> 3 | =PriceList Date Price Quantity ID Description 4 | (PriceList 5 | 2022-09-21 3.99 2 <CH1-A2> <Chisels (pair), 1in & 1¼in> 6 | 2022-10-02 4.49 1 <HV2-K9> <Hammer, 2lb> 7 | 2022-10-02 10.0 1 <SX4-D1> <Eversure Sealant, 13-floz> 8 | ) 9 | -------------------------------------------------------------------------------- /testdata/expected/t19.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" ?> 2 | <uxf version="1"> 3 | <comment>Suitable for SQLite conversion</comment> 4 | <ttypes> 5 | <ttype name="PriceList"> 6 | <field name="Date"/> 7 | <field name="Price"/> 8 | <field name="Quantity"/> 9 | <field name="ID"/> 10 | <field name="Description"/> 11 | </ttype> 12 | </ttypes> 13 | <table name="PriceList"> 14 | <row> 15 | <date v="2022-09-21"/> 16 | <real v="3.99"/> 17 | <int v="2"/> 18 | <str>CH1-A2</str> 19 | <str>Chisels (pair), 1in & 1¼in</str> 20 | </row> 21 | <row> 22 | <date v="2022-10-02"/> 23 | <real v="4.49"/> 24 | <int v="1"/> 25 | <str>HV2-K9</str> 26 | <str>Hammer, 2lb</str> 27 | </row> 28 | <row> 29 | <date v="2022-10-02"/> 30 | <real v="10.0"/> 31 | <int v="1"/> 32 | <str>SX4-D1</str> 33 | <str>Eversure Sealant, 13-floz</str> 34 | </row> 35 | </table> 36 | </uxf> 37 | -------------------------------------------------------------------------------- /testdata/expected/t1c.uxf.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mark-summerfield/uxf/847bfe0ded4499bfbe8eda15f1d107a94654f448/testdata/expected/t1c.uxf.gz -------------------------------------------------------------------------------- /testdata/expected/t2.csv: -------------------------------------------------------------------------------- 1 | "CID","Title","Selected","Date" 2 | 5,"Classical & <Special>",True,"1999-07-21" 3 | 4,"Modern Instrumental",False,"1976-11-30" 4 | 1,"New Acquistions",False,"1947-02-28" 5 | 2,"Pop",False,"1997-10-01" 6 | 3,"Punk",False,"2002-01-17" 7 | 7,"Uncategorized",False,"2020-02-02" 8 | 6,"Unpopular Pop",False,"2022-12-21" 9 | -------------------------------------------------------------------------------- /testdata/expected/t2.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 EPD (simple table) 2 | =Categories CID Title Selected Date 3 | (Categories 4 | 5 <Classical & <Special>> yes 1999-07-21 5 | 4 <Modern Instrumental> no 1976-11-30 6 | 1 <New Acquistions> no 1947-02-28 7 | 2 <Pop> no 1997-10-01 8 | 3 <Punk> no 2002-01-17 9 | 7 <Uncategorized> no 2020-02-02 10 | 6 <Unpopular Pop> no 2022-12-21 11 | ) 12 | -------------------------------------------------------------------------------- /testdata/expected/t2.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" ?> 2 | <uxf version="1" custom="EPD (simple table)"> 3 | <ttypes> 4 | <ttype name="Categories"> 5 | <field name="CID"/> 6 | <field name="Title"/> 7 | <field name="Selected"/> 8 | <field name="Date"/> 9 | </ttype> 10 | </ttypes> 11 | <table name="Categories"> 12 | <row> 13 | <int v="5"/> 14 | <str>Classical & <Special></str> 15 | <yes/> 16 | <date v="1999-07-21"/> 17 | </row> 18 | <row> 19 | <int v="4"/> 20 | <str>Modern Instrumental</str> 21 | <no/> 22 | <date v="1976-11-30"/> 23 | </row> 24 | <row> 25 | <int v="1"/> 26 | <str>New Acquistions</str> 27 | <no/> 28 | <date v="1947-02-28"/> 29 | </row> 30 | <row> 31 | <int v="2"/> 32 | <str>Pop</str> 33 | <no/> 34 | <date v="1997-10-01"/> 35 | </row> 36 | <row> 37 | <int v="3"/> 38 | <str>Punk</str> 39 | <no/> 40 | <date v="2002-01-17"/> 41 | </row> 42 | <row> 43 | <int v="7"/> 44 | <str>Uncategorized</str> 45 | <no/> 46 | <date v="2020-02-02"/> 47 | </row> 48 | <row> 49 | <int v="6"/> 50 | <str>Unpopular Pop</str> 51 | <no/> 52 | <date v="2022-12-21"/> 53 | </row> 54 | </table> 55 | </uxf> 56 | -------------------------------------------------------------------------------- /testdata/expected/t20.json: -------------------------------------------------------------------------------- 1 | { 2 | "UXF^data": { 3 | "UXF^map": { 4 | "comment": null, 5 | "ktype": "str", 6 | "vtype": "list", 7 | "map": { 8 | "Classical": [ 9 | 5, 10 | true 11 | ], 12 | "Modern Instrumental": [ 13 | 4, 14 | false 15 | ], 16 | "New Acquistions": [ 17 | 1, 18 | false 19 | ] 20 | } 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /testdata/expected/t20.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | {str list 3 | <Classical> [ 4 | 5 5 | yes 6 | ] 7 | <Modern Instrumental> [ 8 | 4 9 | no 10 | ] 11 | <New Acquistions> [ 12 | 1 13 | no 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /testdata/expected/t20.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" ?> 2 | <uxf version="1"> 3 | <map ktype="str" vtype="list"> 4 | <key> 5 | <str>Classical</str> 6 | </key> 7 | <value> 8 | <list> 9 | <int v="5"/> 10 | <yes/> 11 | </list> 12 | </value> 13 | <key> 14 | <str>Modern Instrumental</str> 15 | </key> 16 | <value> 17 | <list> 18 | <int v="4"/> 19 | <no/> 20 | </list> 21 | </value> 22 | <key> 23 | <str>New Acquistions</str> 24 | </key> 25 | <value> 26 | <list> 27 | <int v="1"/> 28 | <no/> 29 | </list> 30 | </value> 31 | </map> 32 | </uxf> 33 | -------------------------------------------------------------------------------- /testdata/expected/t21.json: -------------------------------------------------------------------------------- 1 | { 2 | "UXF^comment": " A little note.", 3 | "UXF^data": { 4 | "UXF^list": { 5 | "comment": null, 6 | "vtype": "list", 7 | "list": [ 8 | [ 9 | 5, 10 | "Classical", 11 | true, 12 | { 13 | "UXF^date": "1999-07-21" 14 | } 15 | ], 16 | [ 17 | 4, 18 | "Modern Instrumental", 19 | false, 20 | { 21 | "UXF^date": "1976-11-30" 22 | } 23 | ], 24 | [ 25 | 1, 26 | "New Acquistions", 27 | false, 28 | { 29 | "UXF^date": "1947-02-28" 30 | } 31 | ] 32 | ] 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /testdata/expected/t21.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | #< A little note.> 3 | [list 4 | [ 5 | 5 6 | <Classical> 7 | yes 8 | 1999-07-21 9 | ] 10 | [ 11 | 4 12 | <Modern Instrumental> 13 | no 14 | 1976-11-30 15 | ] 16 | [ 17 | 1 18 | <New Acquistions> 19 | no 20 | 1947-02-28 21 | ] 22 | ] 23 | -------------------------------------------------------------------------------- /testdata/expected/t21.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" ?> 2 | <uxf version="1"> 3 | <comment> A little note.</comment> 4 | <list vtype="list"> 5 | <list> 6 | <int v="5"/> 7 | <str>Classical</str> 8 | <yes/> 9 | <date v="1999-07-21"/> 10 | </list> 11 | <list> 12 | <int v="4"/> 13 | <str>Modern Instrumental</str> 14 | <no/> 15 | <date v="1976-11-30"/> 16 | </list> 17 | <list> 18 | <int v="1"/> 19 | <str>New Acquistions</str> 20 | <no/> 21 | <date v="1947-02-28"/> 22 | </list> 23 | </list> 24 | </uxf> 25 | -------------------------------------------------------------------------------- /testdata/expected/t22.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | =Categories CID:int Title:str Selected:bool Date:date 3 | (Categories 4 | 5 <Classical & <Special>> yes 1999-07-21 5 | 4 <Modern Instrumental> no 1976-11-30 6 | 1 <New Acquistions> no 1947-02-28 7 | 2 <Pop> no 1997-10-01 8 | 3 <Punk> no 2002-01-17 9 | 7 <Uncategorized> no 2020-02-02 10 | 6 <Unpopular Pop> no 2022-12-21 11 | ) 12 | -------------------------------------------------------------------------------- /testdata/expected/t22.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" ?> 2 | <uxf version="1"> 3 | <ttypes> 4 | <ttype name="Categories"> 5 | <field name="CID" vtype="int"/> 6 | <field name="Title" vtype="str"/> 7 | <field name="Selected" vtype="bool"/> 8 | <field name="Date" vtype="date"/> 9 | </ttype> 10 | </ttypes> 11 | <table name="Categories"> 12 | <row> 13 | <int v="5"/> 14 | <str>Classical & <Special></str> 15 | <yes/> 16 | <date v="1999-07-21"/> 17 | </row> 18 | <row> 19 | <int v="4"/> 20 | <str>Modern Instrumental</str> 21 | <no/> 22 | <date v="1976-11-30"/> 23 | </row> 24 | <row> 25 | <int v="1"/> 26 | <str>New Acquistions</str> 27 | <no/> 28 | <date v="1947-02-28"/> 29 | </row> 30 | <row> 31 | <int v="2"/> 32 | <str>Pop</str> 33 | <no/> 34 | <date v="1997-10-01"/> 35 | </row> 36 | <row> 37 | <int v="3"/> 38 | <str>Punk</str> 39 | <no/> 40 | <date v="2002-01-17"/> 41 | </row> 42 | <row> 43 | <int v="7"/> 44 | <str>Uncategorized</str> 45 | <no/> 46 | <date v="2020-02-02"/> 47 | </row> 48 | <row> 49 | <int v="6"/> 50 | <str>Unpopular Pop</str> 51 | <no/> 52 | <date v="2022-12-21"/> 53 | </row> 54 | </table> 55 | </uxf> 56 | -------------------------------------------------------------------------------- /testdata/expected/t23.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | [list 3 | [list 4 | [ 5 | 5 6 | <Classical> 7 | yes 8 | ] 9 | [ 10 | 4 11 | <Modern Instrumental> 12 | no 13 | ] 14 | [ 15 | 1 16 | <New Acquistions> 17 | no 18 | ] 19 | [ 20 | 2 21 | <Pop> 22 | no 23 | ] 24 | [ 25 | 3 26 | <Punk> 27 | no 28 | ] 29 | [ 30 | 7 31 | <Uncategorized> 32 | no 33 | ] 34 | [ 35 | 6 36 | <Unpopular Pop> 37 | no 38 | ] 39 | ] 40 | [list 41 | [ 42 | 4 43 | <ABBA> 44 | 2 45 | no 46 | ] 47 | [ 48 | 38 49 | <Bach> 50 | 5 51 | no 52 | ] 53 | [ 54 | 39 55 | <Bartok> 56 | 5 57 | no 58 | ] 59 | [ 60 | 5 61 | <Beatles> 62 | 2 63 | no 64 | ] 65 | [ 66 | 40 67 | <Beethoven> 68 | 5 69 | no 70 | ] 71 | [ 72 | 6 73 | <Blondie> 74 | 2 75 | no 76 | ] 77 | [ 78 | 52 79 | <Bob Marley> 80 | 6 81 | yes 82 | ] 83 | [ 84 | 7 85 | <Bruce Springsteen> 86 | 2 87 | no 88 | ] 89 | [ 90 | 41 91 | <Chopin> 92 | 5 93 | yes 94 | ] 95 | [ 96 | 37 97 | <Classical> 98 | 5 99 | no 100 | ] 101 | [ 102 | 8 103 | <David Bowie> 104 | 2 105 | no 106 | ] 107 | ] 108 | ] 109 | -------------------------------------------------------------------------------- /testdata/expected/t24.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | =Categories CID:int Title Selected:bool 3 | =Playlists PID:int Title:str CID:int Selected 4 | [table 5 | (Categories 6 | 5 <Classical> yes 7 | 4 <Modern Instrumental> no 8 | 1 <New Acquistions> no 9 | 2 <Pop> no 10 | 3 <Punk> no 11 | ? ? ? 12 | 7 <Uncategorized> no 13 | 6 <Unpopular Pop> no 14 | ) 15 | (Playlists 16 | 4 <ABBA> 2 no 17 | 38 <Bach> 5 no 18 | ? ? ? ? 19 | 39 <Bartok> 5 no 20 | 5 <Beatles> 2 no 21 | 40 <Beethoven> 5 no 22 | 6 <Blondie> 2 no 23 | 52 <Bob Marley> 6 yes 24 | 7 <Bruce Springsteen> 2 no 25 | 41 <Chopin> 5 yes 26 | 37 <Classical> 5 no 27 | 8 <David Bowie> 2 no 28 | 9 <Dire Straits> 2 no 29 | ) 30 | ] 31 | -------------------------------------------------------------------------------- /testdata/expected/t25.json: -------------------------------------------------------------------------------- 1 | { 2 | "UXF^custom": "Price List", 3 | "UXF^ttypes": [ 4 | { 5 | "UXF^ttype": { 6 | "name": "PriceList", 7 | "fields": { 8 | "Date": "date", 9 | "Price": "real", 10 | "Quantity": "int", 11 | "ID": "str", 12 | "Description": "str" 13 | } 14 | } 15 | } 16 | ], 17 | "UXF^data": { 18 | "UXF^table": { 19 | "name": "PriceList", 20 | "comment": null, 21 | "fields": { 22 | "Date": "date", 23 | "Price": "real", 24 | "Quantity": "int", 25 | "ID": "str", 26 | "Description": "str" 27 | }, 28 | "records": [ 29 | [ 30 | { 31 | "UXF^date": "2022-09-21" 32 | }, 33 | 3.99, 34 | 2, 35 | "CH1-A2", 36 | "Chisels (pair), 1in & 1\u00bcin" 37 | ], 38 | [ 39 | { 40 | "UXF^date": "2022-10-02" 41 | }, 42 | 4.49, 43 | 1, 44 | "HV2-K9", 45 | "Hammer, 2lb" 46 | ], 47 | [ 48 | { 49 | "UXF^date": "2022-10-02" 50 | }, 51 | 5.89, 52 | 1, 53 | "SX4-D1", 54 | "Eversure Sealant, 13-floz" 55 | ] 56 | ] 57 | } 58 | } 59 | } -------------------------------------------------------------------------------- /testdata/expected/t25.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 Price List 2 | =PriceList Date:date Price:real Quantity:int ID:str Description:str 3 | (PriceList 4 | 2022-09-21 3.99 2 <CH1-A2> <Chisels (pair), 1in & 1¼in> 5 | 2022-10-02 4.49 1 <HV2-K9> <Hammer, 2lb> 6 | 2022-10-02 5.89 1 <SX4-D1> <Eversure Sealant, 13-floz> 7 | ) 8 | -------------------------------------------------------------------------------- /testdata/expected/t25.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" ?> 2 | <uxf version="1" custom="Price List"> 3 | <ttypes> 4 | <ttype name="PriceList"> 5 | <field name="Date" vtype="date"/> 6 | <field name="Price" vtype="real"/> 7 | <field name="Quantity" vtype="int"/> 8 | <field name="ID" vtype="str"/> 9 | <field name="Description" vtype="str"/> 10 | </ttype> 11 | </ttypes> 12 | <table name="PriceList"> 13 | <row> 14 | <date v="2022-09-21"/> 15 | <real v="3.99"/> 16 | <int v="2"/> 17 | <str>CH1-A2</str> 18 | <str>Chisels (pair), 1in & 1¼in</str> 19 | </row> 20 | <row> 21 | <date v="2022-10-02"/> 22 | <real v="4.49"/> 23 | <int v="1"/> 24 | <str>HV2-K9</str> 25 | <str>Hammer, 2lb</str> 26 | </row> 27 | <row> 28 | <date v="2022-10-02"/> 29 | <real v="5.89"/> 30 | <int v="1"/> 31 | <str>SX4-D1</str> 32 | <str>Eversure Sealant, 13-floz</str> 33 | </row> 34 | </table> 35 | </uxf> 36 | -------------------------------------------------------------------------------- /testdata/expected/t26.json: -------------------------------------------------------------------------------- 1 | { 2 | "UXF^custom": "MyApp 1.2.0 Config", 3 | "UXF^ttypes": [ 4 | { 5 | "UXF^ttype": { 6 | "name": "Files", 7 | "fields": { 8 | "Kind": null, 9 | "Filename": null 10 | } 11 | } 12 | } 13 | ], 14 | "UXF^data": { 15 | "Files": { 16 | "UXF^table": { 17 | "name": "Files", 18 | "comment": null, 19 | "fields": { 20 | "Kind": null, 21 | "Filename": null 22 | }, 23 | "records": [ 24 | [ 25 | "current", 26 | "test1.uxf" 27 | ], 28 | [ 29 | "recent1", 30 | "/tmp/test2.uxf" 31 | ], 32 | [ 33 | "recent2", 34 | "C:\\Users\\mark\\test3.uxf" 35 | ] 36 | ] 37 | } 38 | }, 39 | "General": { 40 | "shapename": "Hexagon", 41 | "showtoolbar": false, 42 | "zoom": 150 43 | }, 44 | "Window1": { 45 | "height": 636, 46 | "scale": 1.1, 47 | "width": 592, 48 | "x": 615, 49 | "y": 252 50 | }, 51 | "Window2": { 52 | "height": 81, 53 | "scale": 1.0, 54 | "width": 140, 55 | "x": 28, 56 | "y": 42 57 | }, 58 | "Window3": { 59 | "height": 22, 60 | "scale": 0.5, 61 | "width": 89, 62 | "x": 57, 63 | "y": 98 64 | } 65 | } 66 | } -------------------------------------------------------------------------------- /testdata/expected/t26.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 MyApp 1.2.0 Config 2 | =Files Kind Filename 3 | { 4 | <Files> (Files 5 | <current> <test1.uxf> 6 | <recent1> </tmp/test2.uxf> 7 | <recent2> <C:\Users\mark\test3.uxf> 8 | ) 9 | <General> { 10 | <shapename> <Hexagon> 11 | <showtoolbar> no 12 | <zoom> 150 13 | } 14 | <Window1> { 15 | <height> 636 16 | <scale> 1.1 17 | <width> 592 18 | <x> 615 19 | <y> 252 20 | } 21 | <Window2> { 22 | <height> 81 23 | <scale> 1.0 24 | <width> 140 25 | <x> 28 26 | <y> 42 27 | } 28 | <Window3> { 29 | <height> 22 30 | <scale> 0.5 31 | <width> 89 32 | <x> 57 33 | <y> 98 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /testdata/expected/t27.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | =Files Kind Filename 3 | {str 4 | <General> {#<Map comment> str 5 | <autosave> yes 6 | <files> (#<Table comment> Files 7 | <current> </home/mark/app/rs/tlm/PlaylistsTest.tlm> 8 | <recent1> </home/mark/app/rs/tlm/PlaylistsTest.tlm> 9 | <recent2> </home/mark/data/playlists-all.tlm> 10 | ) 11 | <historysize> -35 12 | <saved> 2022-03-21 13 | <volume> 0.7 14 | } 15 | <Magic> (:1F8B11FF0C:) 16 | <Nested Map> {str list 17 | <Classical> [ 18 | 5 19 | yes 20 | ] 21 | <Modern Instrumental> [ 22 | 4 23 | no 24 | ] 25 | <Nested List of Lists> [#<List comment> list 26 | [ 27 | 5 28 | <Classical & <Special>> 29 | yes 30 | ] 31 | [ 32 | 4 33 | <Modern Instrumental> 34 | ? 35 | ] 36 | [ 37 | 1 38 | <New Acquistions> 39 | no 40 | ] 41 | ] 42 | <New Acquistions> [ 43 | 1 44 | no 45 | ] 46 | } 47 | <Window> {str 48 | <height> 536 49 | <scale> 1.1 50 | <width> 590 51 | <x> 383 52 | <y> 124 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /testdata/expected/t28.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 TLM Config 2 | =Categories CID:int Title Selected:bool 3 | =Files Kind Filename 4 | =IntPair First:int Second:int 5 | =IPv4 A:int B:int C:int D:int 6 | =Playlists PID Title CID Selected 7 | =RGB Red:int Green:int Blue:int 8 | =RGBA Red:int Green:int Blue:int Alpha:int 9 | { 10 | <General> { 11 | <autosave> yes 12 | <files> (Files 13 | <current> </home/mark/app/rs/tlm/PlaylistsTest.tlm> 14 | <recent1> </home/mark/app/rs/tlm/PlaylistsTest.tlm> 15 | <recent2> </home/mark/data/playlists-all.tlm> 16 | ) 17 | <historysize> -35 18 | <saved> 2022-03-21 19 | <volume> 0.7 20 | } 21 | <Magic> (:1F8B110CFF:) 22 | <Nested Map> { 23 | <Classical> [ 24 | 5 25 | yes 26 | ] 27 | <Modern Instrumental> [ 28 | 4 29 | no 30 | ] 31 | <Nested List of Lists> [list 32 | [ 33 | 5 34 | <Classical> 35 | yes 36 | ] 37 | [ 38 | 4 39 | <Modern Instrumental> 40 | no 41 | ] 42 | [ 43 | 1 44 | <New Acquistions> 45 | no 46 | ] 47 | ] 48 | <Nested Table> (Categories 49 | 5 <Classical> yes 50 | 4 <Modern Instrumental> no 51 | 1 <New Acquistions> no 52 | 2 <Pop> no 53 | 3 <Punk> no 54 | 7 <Uncategorized> ? 55 | ? ? no 56 | ) 57 | <New Acquistions> [ 58 | 1 59 | no 60 | ] 61 | } 62 | <Window> { 63 | <height> 536 64 | <scale> 1.1 65 | <width> 590 66 | <x> 383 67 | <y> 124 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /testdata/expected/t29.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 TLM Config 2 | =Categories CID:int Title:str Selected:bool 3 | =Playlists PID:int Title:str CID:int Selected:bool 4 | {str list <Nested List of Tables> [table 5 | (Categories 6 | 5 <Classical> yes 7 | 4 <Modern Instrumental> no 8 | 1 <New Acquistions> no 9 | 2 <Pop> no 10 | 3 <Punk> no 11 | 7 <Uncategorized> no 12 | 6 <Unpopular Pop> no 13 | ) 14 | (Playlists 15 | 4 <ABBA> 2 no 16 | 38 <Bach> 5 no 17 | 39 <Bartok> 5 no 18 | 5 <Beatles> 2 no 19 | 40 <Beethoven> 5 no 20 | 6 <Blondie> 2 no 21 | 52 <Bob Marley> 6 yes 22 | 7 <Bruce Springsteen> 2 no 23 | 41 <Chopin> 5 yes 24 | 37 <Classical> 5 no 25 | 8 <David Bowie> 2 no 26 | 9 <Dire Straits> 2 no 27 | ) 28 | ]} 29 | -------------------------------------------------------------------------------- /testdata/expected/t2c.uxf.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mark-summerfield/uxf/847bfe0ded4499bfbe8eda15f1d107a94654f448/testdata/expected/t2c.uxf.gz -------------------------------------------------------------------------------- /testdata/expected/t30.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 MyApp 1.2.0 Config 2 | =pos x:int y:int 3 | =size width:int height:int 4 | { 5 | <General> {#<Miscellaneous settings> 6 | <Files> { 7 | <current> <test1.uxf> 8 | <recent> [#<From most to least recent> 9 | </tmp/test2.uxf> 10 | <C:\Users\mark\test3.uxf> 11 | ] 12 | } 13 | <shapename> <Hexagon> 14 | <showtoolbar> no 15 | <zoom> 150 16 | } 17 | <Window1> {#<Window dimensions and scales> str 18 | <pos> (pos 615 252) 19 | <scale> 1.1 20 | <size> (size 592 636) 21 | } 22 | <Window2> { 23 | <pos> (pos 28 42) 24 | <scale> 1.0 25 | <size> (size 140 81) 26 | } 27 | <Window3> { 28 | <pos> (pos 57 98) 29 | <scale> 0.5 30 | <size> (size 89 22) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /testdata/expected/t31.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | =Categories CID:int Title:str Selected:bool 3 | =Playlists PID:int Title:str CID:int Selected:bool 4 | {<Nested Map> { 5 | <Classical> [ 6 | 5 7 | yes 8 | ] 9 | <Modern Instrumental> [ 10 | 4 11 | no 12 | ] 13 | <Nested List of Lists> [ 14 | [ 15 | 5 16 | <Classical> 17 | yes 18 | ] 19 | [ 20 | 4 21 | <Modern Instrumental> 22 | no 23 | ] 24 | [ 25 | 1 26 | <New Acquistions> 27 | no 28 | ] 29 | ] 30 | <Nested List of Tables> [ 31 | (Categories 32 | 5 <Classical> yes 33 | 4 <Modern Instrumental> no 34 | 1 <New Acquistions> no 35 | 2 <Pop> no 36 | 3 <Punk> no 37 | 7 <Uncategorized> no 38 | 6 <Unpopular Pop> no 39 | ) 40 | (Playlists 41 | 4 <ABBA> 2 no 42 | 38 <Bach> 5 no 43 | 39 <Bartok> 5 no 44 | 5 <Beatles> 2 no 45 | 40 <Beethoven> 5 no 46 | 6 <Blondie> 2 no 47 | 52 <Bob Marley> 6 yes 48 | 7 <Bruce Springsteen> 2 no 49 | 41 <Chopin> 5 yes 50 | 37 <Classical> 5 no 51 | 8 <David Bowie> 2 no 52 | 9 <Dire Straits> 2 no 53 | ) 54 | ] 55 | <Nested Table> (Categories 56 | 5 <Classical> yes 57 | 4 <Modern Instrumental> no 58 | 1 <New Acquistions> no 59 | 2 <Pop> no 60 | 3 <Punk> no 61 | 7 <Uncategorized> no 62 | 6 <Unpopular Pop> no 63 | ) 64 | <New Acquistions> [ 65 | 1 66 | no 67 | ] 68 | }} 69 | -------------------------------------------------------------------------------- /testdata/expected/t32.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 MyApp 1.2.0 Config 2 | =#<nonnegative> pos x:int y:int 3 | =#<nonnegative & > 0> size width:int height:int 4 | {#<Notes on this configuration file format> str map 5 | <General> {#<Miscellaneous settings> str 6 | <Files> {str 7 | <current> <test1.uxf> 8 | <recent> [#<From most to least recent> str 9 | </tmp/test2.uxf> 10 | <C:\Users\mark\test3.uxf> 11 | ] 12 | } 13 | <shapename> <Hexagon> 14 | <showtoolbar> no 15 | <zoom> 150 16 | } 17 | <Windows> {#<Window dimensions and scales> 18 | <pos> (pos 19 | 615 252 20 | 28 42 21 | 57 98 22 | ) 23 | <scale> [ 24 | 1.1 25 | 1.0 26 | 0.5 27 | ] 28 | <size> (size 29 | 592 636 30 | 140 81 31 | 89 22 32 | ) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /testdata/expected/t33.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 MyApp 1.2.0 Config 2 | =#<Window dimensions> Geometry x:int y:int width:int height:int scale:real 3 | {#<Notes on this configuration file format> str map 4 | <General> {#<Miscellaneous settings> str 5 | <Files> {str 6 | <current> <test1.uxf> 7 | <recent> [#<From most to least recent> str 8 | </tmp/test2.uxf> 9 | <C:\Users\mark\test3.uxf> 10 | ? 11 | ] 12 | } 13 | <shapename> <Hexagon> 14 | <showtoolbar> no 15 | <zoom> 150 16 | } 17 | <Windows> (#<Window dimensions and scales> Geometry 18 | 615 252 592 636 1.1 19 | 28 42 140 81 1.0 20 | 57 98 89 22 0.5 21 | ? ? ? ? ? 22 | ) 23 | } 24 | -------------------------------------------------------------------------------- /testdata/expected/t34.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 TLM Config 2 | {str map 3 | <Map Test #1> {#<Map with different types of key> 4 | (:757866:) 1985-05-22T04:31:00 5 | 2001-01-31 <world> 6 | 1965-04-27T16:05:00 <UXF in ASCII bytes follows> 7 | 5 6 8 | <hello> 2021-02-01 9 | } 10 | <Map Test #2> {#<Map same type of non-str keys> int 11 | 1 <one> 12 | 2 2 13 | 3 3.0 14 | 4 (:0220:) 15 | } 16 | <Map Test #3> {#<Map same type of non-str keys and values> int date 17 | 1 2019-02-10 18 | 2 1983-04-07 19 | 3 1999-06-09 20 | 4 1973-10-18 21 | 5 2001-12-27 22 | 6 2004-04-11 23 | 7 1992-02-24 24 | } 25 | <Map Test #4> { 26 | 1973-10-18 4 27 | 1983-04-07 2 28 | 1992-02-24 7 29 | 1999-06-09 3 30 | 2001-12-27 5 31 | 2004-04-11 6 32 | 2019-02-10 1 33 | } 34 | <Map Test #5> { 35 | 1973-10-18 4 36 | 1983-04-07 2 37 | 1992-02-24 7 38 | 1999-06-09 3 39 | 2001-12-27 5 40 | 2004-04-11 6 41 | 2019-02-10 1 42 | } 43 | <Map Test #6> {date 44 | 1973-10-18 4 45 | 1983-04-07 2 46 | 1992-02-24 7 47 | 1999-06-09 3 48 | 2001-12-27 5 49 | 2004-04-11 6 50 | 2019-02-10 1 51 | } 52 | <Map Test #7> {date int 53 | 1973-10-18 4 54 | 1983-04-07 2 55 | 1992-02-24 7 56 | 1999-06-09 3 57 | 2001-12-27 5 58 | 2004-04-11 6 59 | 2019-02-10 1 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /testdata/expected/t35.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | #<Suitable for SQLite conversion> 3 | =Categories CID:int title:str selected:bool when:date 4 | =Playlists PID:int title cid:int selected:bool timestamp:datetime 5 | [ 6 | (Categories 7 | 5 <Classical> yes 2001-12-27 8 | 4 <Modern Instrumental> no 1973-10-18 9 | 1 <New Acquistions> no 2019-02-10 10 | 2 <Pop> no 1983-04-07 11 | 3 <Punk> no 1999-06-09 12 | 7 <Uncategorized> no 1992-02-24 13 | 6 <Unpopular Pop> no 2004-04-11 14 | ) 15 | (Playlists 16 | 4 <ABBA> 2 no 1998-09-19T23:57:59 17 | 38 <Bach> 5 no 1982-07-12T23:57:12 18 | 39 <Bartok> 5 no 1983-04-13T23:46:31 19 | 5 <Beatles> 2 no 2022-04-11T23:48:01 20 | 40 <Beethoven> 5 no 1986-06-11T23:47:25 21 | 6 <Blondie> 2 no 1995-11-23T23:56:03 22 | 52 <Bob Marley> 6 yes 1981-02-27T23:56:53 23 | 7 <Bruce Springsteen> 2 no 1995-08-10T23:56:32 24 | 41 <Chopin> 5 yes 1973-11-23T23:53:54 25 | 37 <Classical> 5 no 1992-11-18T23:57:27 26 | 8 <David Bowie> 2 no 2008-09-01T23:59:46 27 | ) 28 | ] 29 | -------------------------------------------------------------------------------- /testdata/expected/t36.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 MyApp Data 2 | #<Suitable for SQLite conversion> 3 | =Customers CID Company Address Contact Email 4 | =Invoices INUM CID Raised_Date Due_Date Paid Description 5 | =Items IID INUM Delivery_Date Unit_Price Quantity Description 6 | [#<There is a 1:M relationship between the Invoices and Items tables> 7 | (Customers 8 | 50 <Best People> <123 Somewhere> <John Doe> <j@doe.com> 9 | 19 <Supersuppliers> <The Square> <Jane Doe> <jane@super.com> 10 | ? ? ? ? ? 11 | ) 12 | (Invoices 13 | 152 50 2022-01-17 2022-02-17 no <COD> 14 | ? ? ? ? ? ? 15 | 153 19 2022-01-19 2022-02-19 yes <> 16 | ) 17 | (Items 18 | ? ? ? ? ? ? 19 | 1839 152 2022-01-16 29.99 2 <Bales of hay> 20 | 1840 152 2022-01-16 5.98 3 <Straps> 21 | 1620 153 2022-01-19 11.5 1 <Washers (1-in)> 22 | ) 23 | ] 24 | -------------------------------------------------------------------------------- /testdata/expected/t37.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 MyApp Data 2 | #<Suitable for SQLite conversion> 3 | =Customers CID:int Company:str Address:str Contact:str Email:str 4 | =Invoices INUM:int CID:int Raised_Date:date Due_Date:date Paid:bool Description:str 5 | =Items IID:int INUM:int Delivery_Date:date Unit_Price:real Quantity:int Description:str 6 | [#<There is a 1:M relationship between the Invoices and Items tables> 7 | (Customers 8 | 50 <Best People> <123 Somewhere> <John Doe> <j@doe.com> 9 | 19 <Supersuppliers> ? <Jane Doe> <jane@super.com> 10 | ) 11 | (Invoices 12 | 152 50 2022-01-17 2022-02-17 no <COD> 13 | 153 19 2022-01-19 2022-02-19 yes <> 14 | ) 15 | (Items 16 | 1839 152 2022-01-16 29.99 2 <Bales of hay> 17 | 1840 152 2022-01-16 5.98 3 <Straps> 18 | 1620 153 2022-01-19 11.5 1 <Washers (1-in)> 19 | ) 20 | ] 21 | -------------------------------------------------------------------------------- /testdata/expected/t38c.uxf.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mark-summerfield/uxf/847bfe0ded4499bfbe8eda15f1d107a94654f448/testdata/expected/t38c.uxf.gz -------------------------------------------------------------------------------- /testdata/expected/t39.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | =Pair First Second 3 | =Triple First Second Third 4 | [#<Nested tables> 5 | (Pair (Pair 17 21) (Pair 98 65)) 6 | (Triple 7 | (Pair <a> <b>) (Triple 2020-01-17 2020-02-18 2021-12-05) (Pair ? no) 8 | 1 2 3 9 | <x> <y> (Pair) 10 | ) 11 | ] 12 | -------------------------------------------------------------------------------- /testdata/expected/t3c.uxf.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mark-summerfield/uxf/847bfe0ded4499bfbe8eda15f1d107a94654f448/testdata/expected/t3c.uxf.gz -------------------------------------------------------------------------------- /testdata/expected/t4.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 EPD (list of tables) 2 | =Categories CID Title Selected 3 | =Playlists PID Title CID Selected 4 | [ 5 | (Categories 6 | 5 <Classical> yes 7 | 4 <Modern Instrumental> no 8 | 1 <New Acquistions> no 9 | 2 <Pop> no 10 | 3 <Punk> no 11 | ? ? ? 12 | 7 <Uncategorized> no 13 | 6 <Unpopular Pop> no 14 | ) 15 | (Playlists 16 | 4 <ABBA> 2 no 17 | 38 <Bach> 5 no 18 | 39 <Bartok> 5 no 19 | 5 <Beatles> 2 no 20 | 40 <Beethoven> 5 no 21 | 6 <Blondie> 2 no 22 | 52 <Bob Marley> 6 yes 23 | 7 <Bruce Springsteen> 2 no 24 | 41 <Chopin> 5 yes 25 | ? ? ? ? 26 | 37 <Classical> 5 no 27 | 8 <David Bowie> 2 no 28 | 9 <Dire Straits> 2 no 29 | ) 30 | ] 31 | -------------------------------------------------------------------------------- /testdata/expected/t40.json: -------------------------------------------------------------------------------- 1 | { 2 | "UXF^ttypes": [ 3 | { 4 | "UXF^ttype": { 5 | "name": "Pair", 6 | "fields": { 7 | "First": null, 8 | "Second": null 9 | } 10 | } 11 | } 12 | ], 13 | "UXF^data": { 14 | "UXF^table": { 15 | "name": "Pair", 16 | "comment": null, 17 | "fields": { 18 | "First": null, 19 | "Second": null 20 | }, 21 | "records": [ 22 | [ 23 | 1, 24 | 2 25 | ], 26 | [ 27 | 3, 28 | 4 29 | ], 30 | [ 31 | 5, 32 | 6 33 | ], 34 | [ 35 | 7, 36 | 8 37 | ], 38 | [ 39 | 9, 40 | 10 41 | ] 42 | ] 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /testdata/expected/t40.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | =Pair First Second 3 | (Pair 4 | 1 2 5 | 3 4 6 | 5 6 7 | 7 8 8 | 9 10 9 | ) 10 | -------------------------------------------------------------------------------- /testdata/expected/t40.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" ?> 2 | <uxf version="1"> 3 | <ttypes> 4 | <ttype name="Pair"> 5 | <field name="First"/> 6 | <field name="Second"/> 7 | </ttype> 8 | </ttypes> 9 | <table name="Pair"> 10 | <row> 11 | <int v="1"/> 12 | <int v="2"/> 13 | </row> 14 | <row> 15 | <int v="3"/> 16 | <int v="4"/> 17 | </row> 18 | <row> 19 | <int v="5"/> 20 | <int v="6"/> 21 | </row> 22 | <row> 23 | <int v="7"/> 24 | <int v="8"/> 25 | </row> 26 | <row> 27 | <int v="9"/> 28 | <int v="10"/> 29 | </row> 30 | </table> 31 | </uxf> 32 | -------------------------------------------------------------------------------- /testdata/expected/t41.json: -------------------------------------------------------------------------------- 1 | { 2 | "UXF^ttypes": [ 3 | { 4 | "UXF^ttype": { 5 | "name": "Pair", 6 | "fields": { 7 | "First": null, 8 | "Second": null 9 | } 10 | } 11 | } 12 | ], 13 | "UXF^data": { 14 | "UXF^table": { 15 | "name": "Pair", 16 | "comment": null, 17 | "fields": { 18 | "First": null, 19 | "Second": null 20 | }, 21 | "records": [ 22 | [ 23 | 1, 24 | 2 25 | ], 26 | [ 27 | 3, 28 | 4 29 | ], 30 | [ 31 | 5, 32 | 6 33 | ], 34 | [ 35 | 7, 36 | 8 37 | ], 38 | [ 39 | [ 40 | 8.6 41 | ], 42 | 10 43 | ] 44 | ] 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /testdata/expected/t41.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | =Pair First Second 3 | (Pair 4 | 1 2 5 | 3 4 6 | 5 6 7 | 7 8 8 | [8.6] 10 9 | ) 10 | -------------------------------------------------------------------------------- /testdata/expected/t41.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" ?> 2 | <uxf version="1"> 3 | <ttypes> 4 | <ttype name="Pair"> 5 | <field name="First"/> 6 | <field name="Second"/> 7 | </ttype> 8 | </ttypes> 9 | <table name="Pair"> 10 | <row> 11 | <int v="1"/> 12 | <int v="2"/> 13 | </row> 14 | <row> 15 | <int v="3"/> 16 | <int v="4"/> 17 | </row> 18 | <row> 19 | <int v="5"/> 20 | <int v="6"/> 21 | </row> 22 | <row> 23 | <int v="7"/> 24 | <int v="8"/> 25 | </row> 26 | <row> 27 | <list> 28 | <real v="8.6"/> 29 | </list> 30 | <int v="10"/> 31 | </row> 32 | </table> 33 | </uxf> 34 | -------------------------------------------------------------------------------- /testdata/expected/t42.json: -------------------------------------------------------------------------------- 1 | { 2 | "UXF^ttypes": [ 3 | { 4 | "UXF^ttype": { 5 | "name": "Pair", 6 | "fields": { 7 | "First": "int", 8 | "Second": "int" 9 | } 10 | } 11 | } 12 | ], 13 | "UXF^data": { 14 | "UXF^table": { 15 | "name": "Pair", 16 | "comment": null, 17 | "fields": { 18 | "First": "int", 19 | "Second": "int" 20 | }, 21 | "records": [ 22 | [ 23 | 1, 24 | 2 25 | ], 26 | [ 27 | 3, 28 | 4 29 | ], 30 | [ 31 | 5, 32 | 6 33 | ], 34 | [ 35 | 7, 36 | 8 37 | ], 38 | [ 39 | 9, 40 | 10 41 | ] 42 | ] 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /testdata/expected/t42.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | =Pair First:int Second:int 3 | (Pair 4 | 1 2 5 | 3 4 6 | 5 6 7 | 7 8 8 | 9 10 9 | ) 10 | -------------------------------------------------------------------------------- /testdata/expected/t42.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" ?> 2 | <uxf version="1"> 3 | <ttypes> 4 | <ttype name="Pair"> 5 | <field name="First" vtype="int"/> 6 | <field name="Second" vtype="int"/> 7 | </ttype> 8 | </ttypes> 9 | <table name="Pair"> 10 | <row> 11 | <int v="1"/> 12 | <int v="2"/> 13 | </row> 14 | <row> 15 | <int v="3"/> 16 | <int v="4"/> 17 | </row> 18 | <row> 19 | <int v="5"/> 20 | <int v="6"/> 21 | </row> 22 | <row> 23 | <int v="7"/> 24 | <int v="8"/> 25 | </row> 26 | <row> 27 | <int v="9"/> 28 | <int v="10"/> 29 | </row> 30 | </table> 31 | </uxf> 32 | -------------------------------------------------------------------------------- /testdata/expected/t43.json: -------------------------------------------------------------------------------- 1 | { 2 | "UXF^ttypes": [ 3 | { 4 | "UXF^ttype": { 5 | "name": "Pair", 6 | "fields": { 7 | "First": "int", 8 | "Second": "list" 9 | } 10 | } 11 | } 12 | ], 13 | "UXF^data": { 14 | "UXF^table": { 15 | "name": "Pair", 16 | "comment": null, 17 | "fields": { 18 | "First": "int", 19 | "Second": "list" 20 | }, 21 | "records": [ 22 | [ 23 | 1, 24 | [] 25 | ], 26 | [ 27 | 2, 28 | [ 29 | "a", 30 | "b" 31 | ] 32 | ], 33 | [ 34 | 3, 35 | [ 36 | 9.8, 37 | 7.1 38 | ] 39 | ] 40 | ] 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /testdata/expected/t43.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | =Pair First:int Second:list 3 | (Pair 4 | 1 [] 5 | 2 [ 6 | <a> 7 | <b> 8 | ] 9 | 3 [ 10 | 9.8 11 | 7.1 12 | ] 13 | ) 14 | -------------------------------------------------------------------------------- /testdata/expected/t43.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" ?> 2 | <uxf version="1"> 3 | <ttypes> 4 | <ttype name="Pair"> 5 | <field name="First" vtype="int"/> 6 | <field name="Second" vtype="list"/> 7 | </ttype> 8 | </ttypes> 9 | <table name="Pair"> 10 | <row> 11 | <int v="1"/> 12 | <list/> 13 | </row> 14 | <row> 15 | <int v="2"/> 16 | <list> 17 | <str>a</str> 18 | <str>b</str> 19 | </list> 20 | </row> 21 | <row> 22 | <int v="3"/> 23 | <list> 24 | <real v="9.8"/> 25 | <real v="7.1"/> 26 | </list> 27 | </row> 28 | </table> 29 | </uxf> 30 | -------------------------------------------------------------------------------- /testdata/expected/t44.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 TLM Config 2 | =IntPair First:int Second:int 3 | =IntQuad First:IntPair Second:IntPair 4 | [ 5 | (IntPair 1 2) 6 | (IntQuad (IntPair 1 2) (IntPair 3 4)) 7 | (IntQuad 8 | (IntPair 1 2) (IntPair 3 4) 9 | (IntPair 5 6) (IntPair 7 8) 10 | (IntPair 9 10) (IntPair 11 12) 11 | ) 12 | ] 13 | -------------------------------------------------------------------------------- /testdata/expected/t45.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | =Pair First Second 3 | =Quad First:Pair Second:Pair 4 | [ 5 | (Quad (Pair 1 2) (Pair 3 4)) 6 | (Quad 7 | (Pair 1 2) (Pair 3 4) 8 | (Pair 5 6) (Pair 7 8) 9 | (Pair 9 10) (Pair 11 12) 10 | ) 11 | ] 12 | -------------------------------------------------------------------------------- /testdata/expected/t47.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 MyApp Data 2 | #<A hierarchical alternative to some foreign key IDs. 3 | We've kept Customers as-is because different invoices may be for the same 4 | customer.> 5 | =Customers CID:int Company:str Address:str Contact:str Email:str 6 | =Invoices INUM:int CID:int Raised_Date:date Due_Date:date Paid:bool Description:str Items:Items 7 | =Items IID:int Delivery_Date:date Unit_Price:real Quantity:int Description:str 8 | [#<There is a 1:M relationship between the Invoices and Items tables> 9 | (Customers 10 | 50 <Best People> <123 Somewhere> <John Doe> <j@doe.com> 11 | 19 <Supersuppliers> ? <Jane Doe> <jane@super.com> 12 | ) 13 | (Invoices 14 | 152 50 2022-01-17 2022-02-17 no <COD> (Items 15 | 1839 2022-01-16 29.99 2 <Bales of hay> 16 | 1840 2022-01-16 5.98 3 <Straps> 17 | ) 18 | 153 19 2022-01-19 2022-02-19 yes <> (Items 1620 2022-01-19 11.5 1 <Washers (1-in)>) 19 | ) 20 | ] 21 | -------------------------------------------------------------------------------- /testdata/expected/t48.json: -------------------------------------------------------------------------------- 1 | { 2 | "UXF^data": [] 3 | } -------------------------------------------------------------------------------- /testdata/expected/t48.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | [] 3 | -------------------------------------------------------------------------------- /testdata/expected/t48.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" ?> 2 | <uxf version="1"> 3 | <list/> 4 | </uxf> 5 | -------------------------------------------------------------------------------- /testdata/expected/t49.json: -------------------------------------------------------------------------------- 1 | { 2 | "UXF^custom": "My Custom Format", 3 | "UXF^data": [] 4 | } -------------------------------------------------------------------------------- /testdata/expected/t49.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 My Custom Format 2 | [] 3 | -------------------------------------------------------------------------------- /testdata/expected/t49.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" ?> 2 | <uxf version="1" custom="My Custom Format"> 3 | <list/> 4 | </uxf> 5 | -------------------------------------------------------------------------------- /testdata/expected/t4c.uxf.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mark-summerfield/uxf/847bfe0ded4499bfbe8eda15f1d107a94654f448/testdata/expected/t4c.uxf.gz -------------------------------------------------------------------------------- /testdata/expected/t50.json: -------------------------------------------------------------------------------- 1 | { 2 | "UXF^comment": "File-level comment", 3 | "UXF^data": [] 4 | } -------------------------------------------------------------------------------- /testdata/expected/t50.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | #<File-level comment> 3 | [] 4 | -------------------------------------------------------------------------------- /testdata/expected/t50.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" ?> 2 | <uxf version="1"> 3 | <comment>File-level comment</comment> 4 | <list/> 5 | </uxf> 6 | -------------------------------------------------------------------------------- /testdata/expected/t51.json: -------------------------------------------------------------------------------- 1 | { 2 | "UXF^custom": "My Custom Format", 3 | "UXF^comment": "Another file-level comment", 4 | "UXF^data": {} 5 | } -------------------------------------------------------------------------------- /testdata/expected/t51.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 My Custom Format 2 | #<Another file-level comment> 3 | {} 4 | -------------------------------------------------------------------------------- /testdata/expected/t51.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" ?> 2 | <uxf version="1" custom="My Custom Format"> 3 | <comment>Another file-level comment</comment> 4 | <map/> 5 | </uxf> 6 | -------------------------------------------------------------------------------- /testdata/expected/t52.json: -------------------------------------------------------------------------------- 1 | { 2 | "UXF^ttypes": [ 3 | { 4 | "UXF^ttype": { 5 | "name": "Pair", 6 | "fields": { 7 | "first": "int", 8 | "second": "int" 9 | } 10 | } 11 | } 12 | ], 13 | "UXF^data": { 14 | "UXF^table": { 15 | "name": "Pair", 16 | "comment": null, 17 | "fields": { 18 | "first": "int", 19 | "second": "int" 20 | }, 21 | "records": [] 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /testdata/expected/t52.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | =Pair first:int second:int 3 | (Pair) 4 | -------------------------------------------------------------------------------- /testdata/expected/t52.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" ?> 2 | <uxf version="1"> 3 | <ttypes> 4 | <ttype name="Pair"> 5 | <field name="first" vtype="int"/> 6 | <field name="second" vtype="int"/> 7 | </ttype> 8 | </ttypes> 9 | <table name="Pair"/> 10 | </uxf> 11 | -------------------------------------------------------------------------------- /testdata/expected/t53.json: -------------------------------------------------------------------------------- 1 | { 2 | "UXF^custom": "My Custom Format", 3 | "UXF^ttypes": [ 4 | { 5 | "UXF^ttype": { 6 | "name": "Pair", 7 | "fields": { 8 | "first": "real", 9 | "second": "real" 10 | } 11 | } 12 | } 13 | ], 14 | "UXF^data": { 15 | "UXF^table": { 16 | "name": "Pair", 17 | "comment": null, 18 | "fields": { 19 | "first": "real", 20 | "second": "real" 21 | }, 22 | "records": [] 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /testdata/expected/t53.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 My Custom Format 2 | =Pair first:real second:real 3 | (Pair) 4 | -------------------------------------------------------------------------------- /testdata/expected/t53.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" ?> 2 | <uxf version="1" custom="My Custom Format"> 3 | <ttypes> 4 | <ttype name="Pair"> 5 | <field name="first" vtype="real"/> 6 | <field name="second" vtype="real"/> 7 | </ttype> 8 | </ttypes> 9 | <table name="Pair"/> 10 | </uxf> 11 | -------------------------------------------------------------------------------- /testdata/expected/t54.json: -------------------------------------------------------------------------------- 1 | { 2 | "UXF^comment": "File-level comment", 3 | "UXF^ttypes": [ 4 | { 5 | "UXF^ttype": { 6 | "name": "Pair", 7 | "fields": { 8 | "first": "str", 9 | "second": "str" 10 | } 11 | } 12 | } 13 | ], 14 | "UXF^data": {} 15 | } -------------------------------------------------------------------------------- /testdata/expected/t54.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | #<File-level comment> 3 | =Pair first:str second:str 4 | {} 5 | -------------------------------------------------------------------------------- /testdata/expected/t54.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" ?> 2 | <uxf version="1"> 3 | <comment>File-level comment</comment> 4 | <ttypes> 5 | <ttype name="Pair"> 6 | <field name="first" vtype="str"/> 7 | <field name="second" vtype="str"/> 8 | </ttype> 9 | </ttypes> 10 | <map/> 11 | </uxf> 12 | -------------------------------------------------------------------------------- /testdata/expected/t55.json: -------------------------------------------------------------------------------- 1 | { 2 | "UXF^custom": "My Custom Format", 3 | "UXF^comment": "Another file-level comment", 4 | "UXF^ttypes": [ 5 | { 6 | "UXF^ttype": { 7 | "name": "Pair", 8 | "fields": { 9 | "first": null, 10 | "second": null 11 | } 12 | } 13 | } 14 | ], 15 | "UXF^data": [] 16 | } -------------------------------------------------------------------------------- /testdata/expected/t55.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 My Custom Format 2 | #<Another file-level comment> 3 | =Pair first second 4 | [] 5 | -------------------------------------------------------------------------------- /testdata/expected/t55.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" ?> 2 | <uxf version="1" custom="My Custom Format"> 3 | <comment>Another file-level comment</comment> 4 | <ttypes> 5 | <ttype name="Pair"> 6 | <field name="first"/> 7 | <field name="second"/> 8 | </ttype> 9 | </ttypes> 10 | <list/> 11 | </uxf> 12 | -------------------------------------------------------------------------------- /testdata/expected/t5c.uxf.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mark-summerfield/uxf/847bfe0ded4499bfbe8eda15f1d107a94654f448/testdata/expected/t5c.uxf.gz -------------------------------------------------------------------------------- /testdata/expected/t5err.txt: -------------------------------------------------------------------------------- 1 | skipping track [818, 'Part One', 1536.0, '/home/mark/music/Mike Oldfield/01 - Part One.ogg', True, 35]: no playlist 2 | skipping track [819, 'Part Two', 1400.0, '/home/mark/music/Mike Oldfield/02 - Part Two.ogg', False, 35]: no playlist 3 | -------------------------------------------------------------------------------- /testdata/expected/t6.json: -------------------------------------------------------------------------------- 1 | { 2 | "UXF^custom": "TLM Config", 3 | "UXF^ttypes": [ 4 | { 5 | "UXF^ttype": { 6 | "name": "Files", 7 | "fields": { 8 | "Kind": null, 9 | "Filename": null 10 | } 11 | } 12 | } 13 | ], 14 | "UXF^data": { 15 | "General": { 16 | "autosave": true, 17 | "files": { 18 | "UXF^table": { 19 | "name": "Files", 20 | "comment": null, 21 | "fields": { 22 | "Kind": null, 23 | "Filename": null 24 | }, 25 | "records": [ 26 | [ 27 | "current", 28 | "/home/mark/app/rs/tlm/PlaylistsTest.tlm" 29 | ], 30 | [ 31 | "recent1", 32 | "/home/mark/app/rs/tlm/PlaylistsTest.tlm" 33 | ], 34 | [ 35 | "recent2", 36 | "/home/mark/data/playlists-all.tlm" 37 | ] 38 | ] 39 | } 40 | }, 41 | "historysize": -35, 42 | "saved": { 43 | "UXF^date": "2022-03-21" 44 | }, 45 | "volume": 0.7 46 | }, 47 | "Magic": { 48 | "UXF^bytes": "1F8B" 49 | }, 50 | "Window": { 51 | "height": 536, 52 | "scale": 1.1, 53 | "width": 590, 54 | "x": 383, 55 | "y": 124 56 | } 57 | } 58 | } -------------------------------------------------------------------------------- /testdata/expected/t6.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 TLM Config 2 | =Files Kind Filename 3 | { 4 | <General> { 5 | <autosave> yes 6 | <files> (Files 7 | <current> </home/mark/app/rs/tlm/PlaylistsTest.tlm> 8 | <recent1> </home/mark/app/rs/tlm/PlaylistsTest.tlm> 9 | <recent2> </home/mark/data/playlists-all.tlm> 10 | ) 11 | <historysize> -35 12 | <saved> 2022-03-21 13 | <volume> 0.7 14 | } 15 | <Magic> (:1F8B:) 16 | <Window> { 17 | <height> 536 18 | <scale> 1.1 19 | <width> 590 20 | <x> 383 21 | <y> 124 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /testdata/expected/t61.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | =b content 3 | =img content image:bytes 4 | =p content 5 | [ 6 | (p <first para>) 7 | (p (img (b <bold caption>) (:B445:))) 8 | ] 9 | -------------------------------------------------------------------------------- /testdata/expected/t61.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" ?> 2 | <uxf version="1"> 3 | <ttypes> 4 | <ttype name="b"> 5 | <field name="content"/> 6 | </ttype> 7 | <ttype name="img"> 8 | <field name="content"/> 9 | <field name="image" vtype="bytes"/> 10 | </ttype> 11 | <ttype name="p"> 12 | <field name="content"/> 13 | </ttype> 14 | </ttypes> 15 | <list> 16 | <table name="p"> 17 | <row> 18 | <str>first para</str> 19 | </row> 20 | </table> 21 | <table name="p"> 22 | <row> 23 | <table name="img"> 24 | <row> 25 | <table name="b"> 26 | <row> 27 | <str>bold caption</str> 28 | </row> 29 | </table> 30 | <bytes>B445</bytes> 31 | </row> 32 | </table> 33 | </row> 34 | </table> 35 | </list> 36 | </uxf> 37 | -------------------------------------------------------------------------------- /testdata/expected/t62.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 TLM Config 2 | !ttype-test.uxi 3 | =Files Kind Filename 4 | =point x:int y:int z:int 5 | { 6 | <files> (Files 7 | <current> </home/mark/app/rs/tlm/PlaylistsTest.tlm> 8 | <recent1> </home/mark/app/rs/tlm/PlaylistsTest.tlm> 9 | <recent2> </home/mark/data/playlists-all.tlm> 10 | ) 11 | <More Tests> [#<A list of name value pairs; normally would be a map> 12 | <one> 13 | (IPv4 141 179 19 9) 14 | <many> 15 | (IPv4 16 | 172 16 254 1 17 | 192 0 2 235 18 | 127 0 0 1 19 | ) 20 | <red> 21 | (rgb 255 0 0) 22 | <semi-transparent blue> 23 | (rgba 0 0 255 80) 24 | <points> 25 | (point 26 | -1 2 3 27 | -4 5 6 28 | -7 8 9 29 | ) 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /testdata/expected/t63.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | !http://localhost:5558/ttype-eg.uxf 3 | !ttype-test.uxi 4 | !complex 5 | !fraction 6 | !t63.uxt 7 | =dob dob:date 8 | =point3d x:int y:int z:int 9 | [ 10 | (img (rgb 0 0 127) (:DECADE:)) 11 | (i <is this oblique?>) 12 | { 13 | 10 (point3d 14 | 3 4 5 15 | 5 12 13 16 | 8 15 17 17 | 7 24 25 18 | ) 19 | 20 (cmyk 0.9 0.9 0.5 0.0) 20 | 30 (pair <one> 2) 21 | } 22 | (Complex 23 | 3.9 -1.4 24 | -170.0 2e-05 25 | ) 26 | (Fraction 22 7) 27 | ] 28 | -------------------------------------------------------------------------------- /testdata/expected/t63r.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | =cmyk cyan:real magenta:real yellow:real black:real 3 | =Complex Real:real Imag:real 4 | =dob dob:date 5 | =Fraction numerator:int denominator:int 6 | =#<italic> i content 7 | =#<image> img content image:bytes 8 | =#<a pair of any two values> pair first second 9 | =point3d x:int y:int z:int 10 | =#<0-255 per component> rgb red:int green:int blue:int 11 | [ 12 | (img (rgb 0 0 127) (:DECADE:)) 13 | (i <is this oblique?>) 14 | { 15 | 10 (point3d 16 | 3 4 5 17 | 5 12 13 18 | 8 15 17 19 | 7 24 25 20 | ) 21 | 20 (cmyk 0.9 0.9 0.5 0.0) 22 | 30 (pair <one> 2) 23 | } 24 | (Complex 25 | 3.9 -1.4 26 | -170.0 2e-05 27 | ) 28 | (Fraction 22 7) 29 | ] 30 | -------------------------------------------------------------------------------- /testdata/expected/t6c.uxf.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mark-summerfield/uxf/847bfe0ded4499bfbe8eda15f1d107a94654f448/testdata/expected/t6c.uxf.gz -------------------------------------------------------------------------------- /testdata/expected/t7.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 TLM Config 2 | =Files Kind Filename 3 | { 4 | <General> {#<Map comment> 5 | <autosave> yes 6 | <files> (#<Table comment> Files 7 | <current> </home/mark/app/rs/tlm/PlaylistsTest.tlm> 8 | <recent1> </home/mark/app/rs/tlm/PlaylistsTest.tlm> 9 | <recent2> </home/mark/data/playlists-all.tlm> 10 | ) 11 | <historysize> -35 12 | <saved> 2022-03-21 13 | <volume> 0.7 14 | } 15 | <Magic> (:1F8B:) 16 | <Nested Map> { 17 | <Classical> [ 18 | 5 19 | yes 20 | ] 21 | <Modern Instrumental> [ 22 | 4 23 | no 24 | ] 25 | <Nested List of Lists> [#<List comment> 26 | [ 27 | 5 28 | <Classical & <Special>> 29 | yes 30 | ] 31 | [ 32 | 4 33 | <Modern Instrumental> 34 | no 35 | ] 36 | [ 37 | 1 38 | <New Acquistions> 39 | ? 40 | ] 41 | ] 42 | <New Acquistions> [ 43 | 1 44 | no 45 | ] 46 | } 47 | <Window> { 48 | <height> 536 49 | <scale> 1.1 50 | <width> 590 51 | <x> 383 52 | <y> 124 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /testdata/expected/t70.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | =Pair first second 3 | (Pair (Pair 1 2) (Pair 3 (Pair 4 5))) 4 | -------------------------------------------------------------------------------- /testdata/expected/t70.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" ?> 2 | <uxf version="1"> 3 | <ttypes> 4 | <ttype name="Pair"> 5 | <field name="first"/> 6 | <field name="second"/> 7 | </ttype> 8 | </ttypes> 9 | <table name="Pair"> 10 | <row> 11 | <table name="Pair"> 12 | <row> 13 | <int v="1"/> 14 | <int v="2"/> 15 | </row> 16 | </table> 17 | <table name="Pair"> 18 | <row> 19 | <int v="3"/> 20 | <table name="Pair"> 21 | <row> 22 | <int v="4"/> 23 | <int v="5"/> 24 | </row> 25 | </table> 26 | </row> 27 | </table> 28 | </row> 29 | </table> 30 | </uxf> 31 | -------------------------------------------------------------------------------- /testdata/expected/t71.json: -------------------------------------------------------------------------------- 1 | { 2 | "UXF^ttypes": [ 3 | { 4 | "UXF^ttype": { 5 | "name": "Decimal" 6 | } 7 | }, 8 | { 9 | "UXF^ttype": { 10 | "name": "Roman" 11 | } 12 | }, 13 | { 14 | "UXF^ttype": { 15 | "name": "p", 16 | "fields": { 17 | "x": null, 18 | "y": null 19 | } 20 | } 21 | } 22 | ], 23 | "UXF^data": [ 24 | { 25 | "UXF^table": { 26 | "name": "Roman", 27 | "comment": null, 28 | "fields": {}, 29 | "records": [] 30 | } 31 | }, 32 | { 33 | "UXF^table": { 34 | "name": "Decimal", 35 | "comment": null, 36 | "fields": {}, 37 | "records": [] 38 | } 39 | }, 40 | { 41 | "UXF^table": { 42 | "name": "Decimal", 43 | "comment": null, 44 | "fields": {}, 45 | "records": [] 46 | } 47 | }, 48 | { 49 | "UXF^list": { 50 | "comment": null, 51 | "vtype": "p", 52 | "list": [ 53 | { 54 | "UXF^table": { 55 | "name": "p", 56 | "comment": null, 57 | "fields": { 58 | "x": null, 59 | "y": null 60 | }, 61 | "records": [ 62 | [ 63 | 1, 64 | 2 65 | ] 66 | ] 67 | } 68 | } 69 | ] 70 | } 71 | } 72 | ] 73 | } -------------------------------------------------------------------------------- /testdata/expected/t71.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | =Decimal 3 | =p x y 4 | =Roman 5 | [ 6 | (Roman) 7 | (Decimal) 8 | (Decimal) 9 | [p (p 1 2)] 10 | ] 11 | -------------------------------------------------------------------------------- /testdata/expected/t71.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" ?> 2 | <uxf version="1"> 3 | <ttypes> 4 | <ttype name="Decimal"/> 5 | <ttype name="p"> 6 | <field name="x"/> 7 | <field name="y"/> 8 | </ttype> 9 | <ttype name="Roman"/> 10 | </ttypes> 11 | <list> 12 | <table name="Roman"/> 13 | <table name="Decimal"/> 14 | <table name="Decimal"/> 15 | <list vtype="p"> 16 | <table name="p"> 17 | <row> 18 | <int v="1"/> 19 | <int v="2"/> 20 | </row> 21 | </table> 22 | </list> 23 | </list> 24 | </uxf> 25 | -------------------------------------------------------------------------------- /testdata/expected/t72.uxi: -------------------------------------------------------------------------------- 1 | uxf 1 2 | !http://localhost:5558/ttype-eg.uxf 3 | !ttype-test.uxi 4 | !complex 5 | !fraction 6 | !t63.uxt 7 | =dob dob:date 8 | =point3d x:int y:int z:int 9 | [ 10 | (:DECADE:) 11 | <is that so?> 12 | { 13 | 10 [ 14 | 3 15 | 4 16 | 5 17 | ] 18 | 20 0.9 19 | 30 <A one> 20 | } 21 | ] 22 | -------------------------------------------------------------------------------- /testdata/expected/t72d.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | [ 3 | (:DECADE:) 4 | <is that so?> 5 | { 6 | 10 [3 4 5] 7 | 20 0.9 8 | 30 <A one> 9 | } 10 | ] 11 | -------------------------------------------------------------------------------- /testdata/expected/t72l.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | !http://localhost:5558/ttype-eg.uxf 3 | !ttype-test.uxi 4 | !complex 5 | !fraction 6 | !t63.uxt 7 | =dob dob:date 8 | =point3d x:int y:int z:int 9 | [ 10 | (:DECADE:) 11 | <is that so?> 12 | { 13 | 10 [3 4 5] 14 | 20 0.9 15 | 30 <A one> 16 | } 17 | ] 18 | -------------------------------------------------------------------------------- /testdata/expected/t72r.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | =dob dob:date 3 | =point3d x:int y:int z:int 4 | [ 5 | (:DECADE:) 6 | <is that so?> 7 | { 8 | 10 [3 4 5] 9 | 20 0.9 10 | 30 <A one> 11 | } 12 | ] 13 | -------------------------------------------------------------------------------- /testdata/expected/t73.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | =T a b c d e f 3 | [ 4 | {<one> 1} 5 | {str <two> 2} 6 | {str 7 | <a> (T 1 2 3 4 5 6) 8 | <b> (T 1 2 3 4 5 6) 9 | <c> (T 1 2 3 4 5 6) 10 | } 11 | {str int <three> 3} 12 | {str T 13 | <a> (T 1 2 3 4 5 6) 14 | <b> (T 1 2 3 4 5 6) 15 | <c> (T 1 2 3 4 5 6) 16 | } 17 | [str <one>] 18 | ] 19 | -------------------------------------------------------------------------------- /testdata/expected/t74.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 MyApp Data 2 | #<A hierarchical alternative to some foreign key IDs. 3 | We've kept Customers as-is because different invoices may be for the same 4 | customer.> 5 | =Customers CID:int Company:str Address:str Contact:str Email:str 6 | =Database customers:Customers invoices:Invoices 7 | =Invoices INUM:int CID:int Raised_Date:date Due_Date:date Paid:bool Description:str Items:Items 8 | =Items IID:int Delivery_Date:date Unit_Price:real Quantity:int Description:str 9 | (#<There is a 1:M relationship between the Invoices and Items tables> Database (Customers 10 | 50 <Best People> <123 Somewhere> <John Doe> <j@doe.com> 11 | 19 <Supersuppliers> ? <Jane Doe> <jane@super.com> 12 | ) 13 | (Invoices 14 | 152 50 2022-01-17 2022-02-17 no <COD> (Items 15 | 1839 2022-01-16 29.99 2 <Bales of hay> 16 | 1840 2022-01-16 5.98 3 <Straps> 17 | ) 18 | 153 19 2022-01-19 2022-02-19 yes <> (Items 1620 2022-01-19 11.5 1 <Washers (1-in)>) 19 | ) 20 | ) 21 | -------------------------------------------------------------------------------- /testdata/expected/t75.json: -------------------------------------------------------------------------------- 1 | { 2 | "UXF^imports": [ 3 | "numeric" 4 | ], 5 | "UXF^ttypes": [ 6 | { 7 | "UXF^ttype": { 8 | "name": "Complex", 9 | "fields": { 10 | "Real": "real", 11 | "Imag": "real" 12 | } 13 | } 14 | }, 15 | { 16 | "UXF^ttype": { 17 | "name": "Fraction", 18 | "fields": { 19 | "numerator": "int", 20 | "denominator": "int" 21 | } 22 | } 23 | } 24 | ], 25 | "UXF^data": [ 26 | { 27 | "UXF^table": { 28 | "name": "Complex", 29 | "comment": null, 30 | "fields": { 31 | "Real": "real", 32 | "Imag": "real" 33 | }, 34 | "records": [ 35 | [ 36 | 3.9, 37 | -1.4 38 | ], 39 | [ 40 | -170.0, 41 | 2e-05 42 | ] 43 | ] 44 | } 45 | }, 46 | { 47 | "UXF^table": { 48 | "name": "Fraction", 49 | "comment": null, 50 | "fields": { 51 | "numerator": "int", 52 | "denominator": "int" 53 | }, 54 | "records": [ 55 | [ 56 | 22, 57 | 7 58 | ] 59 | ] 60 | } 61 | } 62 | ] 63 | } -------------------------------------------------------------------------------- /testdata/expected/t75.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | !numeric 3 | [ 4 | (Complex 5 | 3.9 -1.4 6 | -170.0 2e-05 7 | ) 8 | (Fraction 22 7) 9 | ] 10 | -------------------------------------------------------------------------------- /testdata/expected/t75.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" ?> 2 | <uxf version="1"> 3 | <imports> 4 | <import filename="numeric"/> 5 | </imports> 6 | <ttypes> 7 | <ttype name="Complex"> 8 | <field name="Real" vtype="real"/> 9 | <field name="Imag" vtype="real"/> 10 | </ttype> 11 | <ttype name="Fraction"> 12 | <field name="numerator" vtype="int"/> 13 | <field name="denominator" vtype="int"/> 14 | </ttype> 15 | </ttypes> 16 | <list> 17 | <table name="Complex"> 18 | <row> 19 | <real v="3.9"/> 20 | <real v="-1.4"/> 21 | </row> 22 | <row> 23 | <real v="-170.0"/> 24 | <real v="2e-05"/> 25 | </row> 26 | </table> 27 | <table name="Fraction"> 28 | <row> 29 | <int v="22"/> 30 | <int v="7"/> 31 | </row> 32 | </table> 33 | </list> 34 | </uxf> 35 | -------------------------------------------------------------------------------- /testdata/expected/t77.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 Map comparison test 2 | #<t77.uxf == t78.uxf even though maps have different orders> 3 | =IPv4 A:int B:int C:int D:int 4 | =#<0-255 per component> rgb red:int green:int blue:int 5 | =#<0-255 per component> rgba red:int green:int blue:int alpha:int 6 | { 7 | <General> { 8 | <autosave> yes 9 | <files> { 10 | <current> </home/mark/app/rs/tlm/PlaylistsTest.tlm> 11 | <recent1> </home/mark/app/rs/tlm/PlaylistsTest.tlm> 12 | <recent2> </home/mark/data/playlists-all.tlm> 13 | } 14 | <historysize> -35 15 | <saved> 2022-03-21 16 | <volume> 0.7 17 | } 18 | <Magic> (:1F8B:) 19 | <More Tests> { 20 | <many> (IPv4 21 | 172 16 254 1 22 | 192 0 2 235 23 | 127 0 0 1 24 | ) 25 | <one> (IPv4 141 179 19 9) 26 | <red> (rgb 255 0 0) 27 | <semi-transparent blue> (rgba 0 0 255 80) 28 | } 29 | <Nested Map> { 30 | <Classical> [ 31 | 5 32 | yes 33 | ] 34 | <Modern Instrumental> [ 35 | 4 36 | no 37 | ] 38 | <New Acquistions> [ 39 | 1 40 | no 41 | ] 42 | } 43 | <Window> { 44 | <pos> [ 45 | 383 46 | 124 47 | ] 48 | <scale> 1.1 49 | <size> [ 50 | 590 51 | 536 52 | ] 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /testdata/expected/t78.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 Map comparison test 2 | #<t77.uxf == t78.uxf even though maps have different orders> 3 | =IPv4 A:int B:int C:int D:int 4 | =#<0-255 per component> rgb red:int green:int blue:int 5 | =#<0-255 per component> rgba red:int green:int blue:int alpha:int 6 | { 7 | <General> { 8 | <autosave> yes 9 | <files> { 10 | <current> </home/mark/app/rs/tlm/PlaylistsTest.tlm> 11 | <recent1> </home/mark/app/rs/tlm/PlaylistsTest.tlm> 12 | <recent2> </home/mark/data/playlists-all.tlm> 13 | } 14 | <historysize> -35 15 | <saved> 2022-03-21 16 | <volume> 0.7 17 | } 18 | <Magic> (:1F8B:) 19 | <More Tests> { 20 | <many> (IPv4 21 | 172 16 254 1 22 | 192 0 2 235 23 | 127 0 0 1 24 | ) 25 | <one> (IPv4 141 179 19 9) 26 | <red> (rgb 255 0 0) 27 | <semi-transparent blue> (rgba 0 0 255 80) 28 | } 29 | <Nested Map> { 30 | <Classical> [ 31 | 5 32 | yes 33 | ] 34 | <Modern Instrumental> [ 35 | 4 36 | no 37 | ] 38 | <New Acquistions> [ 39 | 1 40 | no 41 | ] 42 | } 43 | <Window> { 44 | <pos> [ 45 | 383 46 | 124 47 | ] 48 | <scale> 1.1 49 | <size> [ 50 | 590 51 | 536 52 | ] 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /testdata/expected/t79.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 Custom text 2 | #<File level comment> 3 | =IPv4 A:int B:int C:int D:int 4 | =#<0-255 per component> rgb red:int green:int blue:int 5 | =#<0-255 per component> rgba red:int green:int blue:int alpha:int 6 | { 7 | <General> {#<Map comment> 8 | <autosave> yes 9 | <files> { 10 | <current> </home/mark/app/rs/tlm/PlaylistsTest.tlm> 11 | <recent1> </home/mark/app/rs/tlm/PlaylistsTest.tlm> 12 | <recent2> </home/mark/data/playlists-all.tlm> 13 | } 14 | <historysize> -35 15 | <saved> 2022-03-21 16 | <volume> 0.7 17 | } 18 | <Magic> (:1F8B:) 19 | <More Tests> { 20 | <many> (#<Table comment> IPv4 21 | 172 16 254 1 22 | 192 0 2 235 23 | 127 0 0 1 24 | ) 25 | <one> (IPv4 141 179 19 9) 26 | <red> (rgb 255 0 0) 27 | <semi-transparent blue> (rgba 0 0 255 80) 28 | } 29 | <Nested Map> { 30 | <Classical> [ 31 | 5 32 | yes 33 | ] 34 | <Modern Instrumental> [#<List comment> 35 | 4 36 | no 37 | ] 38 | <New Acquistions> [ 39 | 1 40 | no 41 | ] 42 | } 43 | <Window> { 44 | <pos> [ 45 | 383 46 | 124 47 | ] 48 | <scale> 1.1 49 | <size> [ 50 | 590 51 | 536 52 | ] 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /testdata/expected/t7c.uxf.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mark-summerfield/uxf/847bfe0ded4499bfbe8eda15f1d107a94654f448/testdata/expected/t7c.uxf.gz -------------------------------------------------------------------------------- /testdata/expected/t8.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 TLM Config 2 | #<A single comment may be placed at the start after the uxf header and 3 | before evertthing else.> 4 | =Categories CID Title Selected 5 | =Files Kind Filename 6 | { 7 | <General> { 8 | <autosave> yes 9 | <files> (Files 10 | <current> </home/mark/app/rs/tlm/PlaylistsTest.tlm> 11 | <recent1> </home/mark/app/rs/tlm/PlaylistsTest.tlm> 12 | <recent2> </home/mark/data/playlists-all.tlm> 13 | ) 14 | <historysize> -35 15 | <saved> 2022-03-21 16 | <volume> 0.7 17 | } 18 | <Magic> (:1F8B:) 19 | <Nested Dict> { 20 | <Classical> [ 21 | 5 22 | yes 23 | ] 24 | <Modern Instrumental> [ 25 | 4 26 | no 27 | ] 28 | <Nested List of Lists> [ 29 | [ 30 | 5 31 | <Classical> 32 | yes 33 | ] 34 | [ 35 | 4 36 | <Modern Instrumental> 37 | no 38 | ] 39 | [ 40 | 1 41 | <New Acquistions> 42 | no 43 | ] 44 | ] 45 | <Nested Table> (Categories 46 | 5 <Classical> yes 47 | 4 <Modern Instrumental> no 48 | 1 <New Acquistions> no 49 | 2 <Pop> no 50 | 3 <Punk> ? 51 | ? ? no 52 | 6 <Unpopular Pop> no 53 | ) 54 | <New Acquistions> [ 55 | 1 56 | no 57 | ] 58 | } 59 | <Window> { 60 | <height> 536 61 | <scale> 1.1 62 | <width> 590 63 | <x> 383 64 | <y> 124 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /testdata/expected/t80.json: -------------------------------------------------------------------------------- 1 | { 2 | "UXF^comment": "last modified 1 April 2001 by John Doe", 3 | "UXF^data": { 4 | "database": { 5 | "UXF^map": { 6 | "comment": "use IP address in case network name resolution is not working", 7 | "ktype": null, 8 | "vtype": null, 9 | "map": { 10 | "file": "payroll.dat", 11 | "port": 143, 12 | "server": "192.0.2.62" 13 | } 14 | } 15 | }, 16 | "owner": { 17 | "name": "John Doe", 18 | "organization": "Acme Widgets Inc." 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /testdata/expected/t80.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | #<last modified 1 April 2001 by John Doe> 3 | { 4 | <database> {#<use IP address in case network name resolution is not working> 5 | <file> <payroll.dat> 6 | <port> 143 7 | <server> <192.0.2.62> 8 | } 9 | <owner> { 10 | <name> <John Doe> 11 | <organization> <Acme Widgets Inc.> 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /testdata/expected/t80.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" ?> 2 | <uxf version="1"> 3 | <comment>last modified 1 April 2001 by John Doe</comment> 4 | <map> 5 | <key> 6 | <str>database</str> 7 | </key> 8 | <value> 9 | <map> 10 | <comment>use IP address in case network name resolution is not working</comment> 11 | <key> 12 | <str>file</str> 13 | </key> 14 | <value> 15 | <str>payroll.dat</str> 16 | </value> 17 | <key> 18 | <str>port</str> 19 | </key> 20 | <value> 21 | <int v="143"/> 22 | </value> 23 | <key> 24 | <str>server</str> 25 | </key> 26 | <value> 27 | <str>192.0.2.62</str> 28 | </value> 29 | </map> 30 | </value> 31 | <key> 32 | <str>owner</str> 33 | </key> 34 | <value> 35 | <map> 36 | <key> 37 | <str>name</str> 38 | </key> 39 | <value> 40 | <str>John Doe</str> 41 | </value> 42 | <key> 43 | <str>organization</str> 44 | </key> 45 | <value> 46 | <str>Acme Widgets Inc.</str> 47 | </value> 48 | </map> 49 | </value> 50 | </map> 51 | </uxf> 52 | -------------------------------------------------------------------------------- /testdata/expected/t81.json: -------------------------------------------------------------------------------- 1 | { 2 | "UXF^comment": "last modified 1 April 2001 by John Doe", 3 | "UXF^ttypes": [ 4 | { 5 | "UXF^ttype": { 6 | "name": "Database", 7 | "fields": { 8 | "server": "str", 9 | "port": "int", 10 | "file": "str" 11 | }, 12 | "comment": "use IP address in case network name resolution is not working" 13 | } 14 | }, 15 | { 16 | "UXF^ttype": { 17 | "name": "Owner", 18 | "fields": { 19 | "name": "str", 20 | "organization": "str" 21 | } 22 | } 23 | } 24 | ], 25 | "UXF^data": [ 26 | { 27 | "UXF^table": { 28 | "name": "Owner", 29 | "comment": null, 30 | "fields": { 31 | "name": "str", 32 | "organization": "str" 33 | }, 34 | "records": [ 35 | [ 36 | "John Doe", 37 | "Acme Widgets Inc." 38 | ] 39 | ] 40 | } 41 | }, 42 | { 43 | "UXF^table": { 44 | "name": "Database", 45 | "comment": null, 46 | "fields": { 47 | "server": "str", 48 | "port": "int", 49 | "file": "str" 50 | }, 51 | "records": [ 52 | [ 53 | "192.0.2.62", 54 | 143, 55 | "payroll.dat" 56 | ] 57 | ] 58 | } 59 | } 60 | ] 61 | } -------------------------------------------------------------------------------- /testdata/expected/t81.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | #<last modified 1 April 2001 by John Doe> 3 | =#<use IP address in case network name resolution is not working> Database server:str port:int 4 | file:str 5 | =Owner name:str organization:str 6 | [ 7 | (Owner <John Doe> <Acme Widgets Inc.>) 8 | (Database <192.0.2.62> 143 <payroll.dat>) 9 | ] 10 | -------------------------------------------------------------------------------- /testdata/expected/t81.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" ?> 2 | <uxf version="1"> 3 | <comment>last modified 1 April 2001 by John Doe</comment> 4 | <ttypes> 5 | <ttype name="Database"> 6 | <comment>use IP address in case network name resolution is not working</comment> 7 | <field name="server" vtype="str"/> 8 | <field name="port" vtype="int"/> 9 | <field name="file" vtype="str"/> 10 | </ttype> 11 | <ttype name="Owner"> 12 | <field name="name" vtype="str"/> 13 | <field name="organization" vtype="str"/> 14 | </ttype> 15 | </ttypes> 16 | <list> 17 | <table name="Owner"> 18 | <row> 19 | <str>John Doe</str> 20 | <str>Acme Widgets Inc.</str> 21 | </row> 22 | </table> 23 | <table name="Database"> 24 | <row> 25 | <str>192.0.2.62</str> 26 | <int v="143"/> 27 | <str>payroll.dat</str> 28 | </row> 29 | </table> 30 | </list> 31 | </uxf> 32 | -------------------------------------------------------------------------------- /testdata/expected/t82.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | =Feature geometry properties:map 3 | =LineString x:real y:real 4 | =Point x:real y:real 5 | =Polygon x:real y:real 6 | (Feature 7 | (Point 102.0 0.5) {<prop0> <value0>} 8 | (LineString 9 | 102.0 0.0 10 | 103.0 1.0 11 | 104.0 0.0 12 | 105.0 1.0 13 | ) 14 | { 15 | <prop0> <value0> 16 | <prop1> 0.0 17 | } 18 | (Polygon 19 | 100.0 0.0 20 | 101.0 0.0 21 | 101.0 1.0 22 | 100.0 1.0 23 | 100.0 0.0 24 | ) 25 | { 26 | <prop0> <value0> 27 | <prop1> {<this> <that>} 28 | } 29 | ) 30 | -------------------------------------------------------------------------------- /testdata/expected/t83.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | #<UXF version of TOML Example> 3 | =Clients a b 4 | =Database server:str ports:list connection_max:int enabled:bool 5 | =DateTime base:datetime offset:str 6 | =Hosts name:str 7 | =Owner name:str dob:DateTime 8 | =Server name:str ip:str dc:str 9 | [ 10 | (Owner <Tom Preston-Werner> (DateTime 1979-05-27T07:32:00 <-08:00>)) 11 | (Database <192.168.1.1> [ 12 | 8000 13 | 8001 14 | 8002 15 | ] 5000 yes) 16 | (Server 17 | <alpha> <10.0.0.1> <eqdc10> 18 | <beta> <10.0.0.2> <eqdc10> 19 | ) 20 | (Clients 21 | <gamma> <delta> 22 | 1 2 23 | ) 24 | (Hosts 25 | <alpha> 26 | <omega> 27 | ) 28 | ] 29 | -------------------------------------------------------------------------------- /testdata/expected/t84.json: -------------------------------------------------------------------------------- 1 | { 2 | "UXF^comment": "File level comment for testing string concatenation with the & operator.", 3 | "UXF^ttypes": [ 4 | { 5 | "UXF^ttype": { 6 | "name": "A", 7 | "fields": { 8 | "a": null 9 | }, 10 | "comment": "ttype comment for tests" 11 | } 12 | } 13 | ], 14 | "UXF^data": { 15 | "UXF^list": { 16 | "comment": "list comment for a list long comment test", 17 | "vtype": null, 18 | "list": [ 19 | { 20 | "UXF^table": { 21 | "name": "A", 22 | "comment": "table comment as another test", 23 | "fields": { 24 | "a": null 25 | }, 26 | "records": [ 27 | [ 28 | "an imaginary very long string to test string concatenation" 29 | ], 30 | [ 31 | { 32 | "UXF^bytes": "AB0154708140485899F065202122" 33 | } 34 | ] 35 | ] 36 | } 37 | }, 38 | { 39 | "UXF^map": { 40 | "comment": "map comment to test map comments", 41 | "ktype": null, 42 | "vtype": null, 43 | "map": {} 44 | } 45 | } 46 | ] 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /testdata/expected/t84.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | #<File level comment for testing string concatenation with the & operator.> 3 | =#<ttype comment for tests> A a 4 | [#<list comment for a list long comment test> 5 | (#<table comment as another test> A 6 | <an imaginary very long string to test string concatenation> 7 | (:AB0154708140485899F065202122:) 8 | ) 9 | {#<map comment to test map comments>} 10 | ] 11 | -------------------------------------------------------------------------------- /testdata/expected/t84.xml: -------------------------------------------------------------------------------- 1 | <?xml version="1.0" ?> 2 | <uxf version="1"> 3 | <comment>File level comment for testing string concatenation with the & operator.</comment> 4 | <ttypes> 5 | <ttype name="A"> 6 | <comment>ttype comment for tests</comment> 7 | <field name="a"/> 8 | </ttype> 9 | </ttypes> 10 | <list> 11 | <comment>list comment for a list long comment test</comment> 12 | <table name="A"> 13 | <comment>table comment as another test</comment> 14 | <row> 15 | <str>an imaginary very long string to test string concatenation</str> 16 | </row> 17 | <row> 18 | <bytes>AB0154708140485899F065202122</bytes> 19 | </row> 20 | </table> 21 | <map> 22 | <comment>map comment to test map comments</comment> 23 | </map> 24 | </list> 25 | </uxf> 26 | -------------------------------------------------------------------------------- /testdata/expected/t86.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | =Feature geometry properties:map 3 | =LineString points:Point 4 | =Point x:real y:real 5 | =Polygon points:Point 6 | (Feature 7 | (Point 102.0 0.5) {<prop0> <value0>} 8 | (LineString (Point 9 | 102.0 0.0 10 | 103.0 1.0 11 | 104.0 0.0 12 | 105.0 1.0 13 | ) 14 | ) { 15 | <prop0> <value0> 16 | <prop1> 0.0 17 | } 18 | (Polygon (Point 19 | 100.0 0.0 20 | 101.0 0.0 21 | 101.0 1.0 22 | 100.0 1.0 23 | 100.0 0.0 24 | ) 25 | ) { 26 | <prop0> <value0> 27 | <prop1> {<this> <that>} 28 | } 29 | ) 30 | -------------------------------------------------------------------------------- /testdata/expected/t8c.uxf.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mark-summerfield/uxf/847bfe0ded4499bfbe8eda15f1d107a94654f448/testdata/expected/t8c.uxf.gz -------------------------------------------------------------------------------- /testdata/expected/t9.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 TLM Config 2 | =Categories CID Title Selected 3 | =Playlists PID Title CID Selected 4 | {<Nested List of Tables> [ 5 | (Categories 6 | 5 <Classical> yes 7 | 4 <Modern Instrumental> no 8 | 1 <New Acquistions> no 9 | 2 <Pop> no 10 | 3 <Punk> no 11 | 7 <Uncategorized> no 12 | 6 <Unpopular Pop> no 13 | ) 14 | (Playlists 15 | 4 <ABBA> 2 no 16 | 38 <Bach> 5 no 17 | 39 <Bartok> 5 no 18 | 5 <Beatles> 2 no 19 | 40 <Beethoven> 5 no 20 | 6 <Blondie> 2 no 21 | 52 <Bob Marley> 6 yes 22 | 7 <Bruce Springsteen> 2 no 23 | 41 <Chopin> 5 yes 24 | 37 <Classical> 5 no 25 | 8 <David Bowie> 2 no 26 | 9 <Dire Straits> 2 no 27 | ) 28 | ]} 29 | -------------------------------------------------------------------------------- /testdata/expected/t9c.uxf.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mark-summerfield/uxf/847bfe0ded4499bfbe8eda15f1d107a94654f448/testdata/expected/t9c.uxf.gz -------------------------------------------------------------------------------- /testdata/expected/tlm-eg1.uxx.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mark-summerfield/uxf/847bfe0ded4499bfbe8eda15f1d107a94654f448/testdata/expected/tlm-eg1.uxx.gz -------------------------------------------------------------------------------- /testdata/expected/tlm-eg2.uxx.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mark-summerfield/uxf/847bfe0ded4499bfbe8eda15f1d107a94654f448/testdata/expected/tlm-eg2.uxx.gz -------------------------------------------------------------------------------- /testdata/i64.uxi: -------------------------------------------------------------------------------- 1 | uxf 1 2 | !http://localhost:5558/ttype-eg.uxf 3 | !ttype-test.uxi 4 | !i64.uxi 5 | =point3d x:int y:int z:int 6 | =dob dob:date 7 | [ 8 | (img (rgb 0 0 127) (:DECADE:)) 9 | (i <is this oblique?>) 10 | { 11 | 10 (point3d 3 4 5 5 12 13 8 15 17 7 24 25) 12 | 20 (cmyk 0.9 0.9 0.5 0.0) 13 | 30 (pair <one> 2) 14 | } 15 | ] 16 | -------------------------------------------------------------------------------- /testdata/i65.uxi: -------------------------------------------------------------------------------- 1 | uxf 1 2 | !http://localhost:5558/ttype-eg.uxf 3 | !ttype-test.uxi 4 | !i66.uxi 5 | =point3d x:int y:int z:int 6 | =dob dob:date 7 | [ 8 | (img (rgb 0 0 127) (:DECADE:)) 9 | (i <is this oblique?>) 10 | { 11 | 10 (point3d 3 4 5 5 12 13 8 15 17 7 24 25) 12 | 30 (pair <one> 2) 13 | } 14 | ] 15 | -------------------------------------------------------------------------------- /testdata/i66.uxi: -------------------------------------------------------------------------------- 1 | uxf 1 2 | !http://localhost:5558/ttype-eg.uxf 3 | !ttype-test.uxi 4 | !i65.uxi 5 | =point3d x:int y:int z:int 6 | =dob dob:date 7 | [ 8 | (img (rgb 0 0 127) (:DECADE:)) 9 | (i <is this oblique?>) 10 | { 11 | 10 (point3d 3 4 5 5 12 13 8 15 17 7 24 25) 12 | 30 (pair <one> 2) 13 | } 14 | ] 15 | -------------------------------------------------------------------------------- /testdata/i67.uxi: -------------------------------------------------------------------------------- 1 | uxf 1 2 | !http://localhost:5558/ttype-eg.uxf 3 | !ttype-test.uxi 4 | !t63.uxt 5 | !ttype-test.uxi 6 | !http://localhost:5558/ttype-eg.uxf 7 | !t63.uxt 8 | =point3d x:int y:int z:int 9 | =dob dob:date 10 | [ 11 | (img (rgb 0 0 127) (:DECADE:)) 12 | (i <is this oblique?>) 13 | { 14 | 10 (point3d 3 4 5 5 12 13 8 15 17 7 24 25) 15 | 30 (pair <one> 2) 16 | } 17 | ] 18 | -------------------------------------------------------------------------------- /testdata/i68.uxi: -------------------------------------------------------------------------------- 1 | uxf 1 UXF Include 2 | =include filename:str 3 | (include 4 | <t15.uxf> 5 | <t16.uxf> 6 | <t19.uxf> 7 | <t47.uxf> 8 | <t63.uxf> 9 | ) 10 | -------------------------------------------------------------------------------- /testdata/i69.uxi: -------------------------------------------------------------------------------- 1 | uxf 1 2 | !http://localhost:5558/ttype-eg.uxf 3 | !ttype-test.uxi 4 | !t63.uxt 5 | !ttype-test.uxi 6 | !http://localhost:5558/ttype-eg.uxf 7 | !t63.uxt 8 | =point3d x:int y:int z:int 9 | =dob dob:date 10 | [ 11 | (img (rgb 0 0 127) (:DECADE:)) 12 | (i <is this oblique?>) 13 | { 14 | 30 (pair <one> 2) 15 | } 16 | ] 17 | -------------------------------------------------------------------------------- /testdata/l56.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | = Categories CID:int title:str selected:bool when:date 3 | = Playlists PID:int title cid:int selected:real timestamp:datetime 4 | [ 5 | (Categories 6 | 5 <Classical> yes 2001-12-27 7 | 4 <Modern Instrumental> no 1973-10-18 8 | 1 <New Acquistions> no 2019-02-10 9 | <2> <Pop> no <1983-04-07> 10 | 3 <Punk> no 1999-06-09 11 | 7.2 <Uncategorized> no 1992-02-24 12 | 6 <Unpopular Pop> no 2004-04-11 13 | ) 14 | (Playlists 15 | 4 <ABBA> 2 <wrong> 1998-09-19T23:57:59 16 | 38 <Bach> 5 2.0 1982-07-12T23:57:12 17 | 39 <Bartok> 5 -3.0 1983-04-13T23:46:31 18 | 5 <Beatles> 2 4 2022-04-11T23:48:01 19 | 40 <Beethoven> 5 ? 1986-06-11T23:47:25 20 | 6 <Blondie> 2 <6.7> 1995-11-23T23:56:03 21 | 52 <Bob Marley> 6 <9> 1981-02-27T23:56:53 22 | 7 <Bruce Springsteen> 2 -8 1995-08-10T23:56:32 23 | 41 <Chopin> 5 11 1973-11-23T23:53:54 24 | 37 <Classical> 5 no 1992-11-18T23:57:27 25 | 8 <David Bowie> 2 yes <2008-09-01T23:59:46> 26 | ) 27 | ] 28 | -------------------------------------------------------------------------------- /testdata/l57.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | = Categories CID:int title:str selected:bool when:date 3 | = Playlists PID:int title cid:int selected:real timestamp:datetime 4 | [ 5 | (Categories 6 | 5 <Classical> yes 2001-12-27 7 | 4 <Modern Instrumental> no 1973-10-18 8 | 1 <New Acquistions> no 2019-02-10 9 | 2 <Pop> no 1983-04-07 10 | 3 <Punk> no 1999-06-09 11 | 7 <Uncategorized> no 1992-02-24 12 | 6 <Unpopular Pop> no 2004-04-11 13 | ) 14 | (Playlists 15 | 4 <ABBA> 2 <wrong> 1998-09-19T23:57:59 16 | 38 <Bach> 5 2.0 1982-07-12T23:57:12 17 | 39 <Bartok> 5 -3.0 1983-04-13T23:46:31 18 | 5 <Beatles> 2 4.0 2022-04-11T23:48:01 19 | 40 <Beethoven> 5 ? 1986-06-11T23:47:25 20 | 6 <Blondie> 2 6.7 1995-11-23T23:56:03 21 | 52 <Bob Marley> 6 9 1981-02-27T23:56:53 22 | 7 <Bruce Springsteen> 2 -8.0 1995-08-10T23:56:32 23 | 41 <Chopin> 5 11.0 1973-11-23T23:53:54 24 | 37 <Classical> 5 0.0 1992-11-18T23:57:27 25 | 8 <David Bowie> 2 1.0 2008-09-01T23:59:46 26 | ) 27 | ] 28 | -------------------------------------------------------------------------------- /testdata/l58.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | #<More linting test data> 3 | =B b:bool 4 | =I i:int 5 | =R r:real 6 | =D d:date 7 | =dt dt:datetime 8 | =S s:str 9 | =by b:bytes 10 | =p a:int b:int 11 | [table 12 | (B yes no 13 | <yes> <no> <t> <f> <true> <false> <duh>) 14 | (I -1 0 1 -0.1 -1.0 0.0 0.1 1.0 15 | <-1> <0> <1> 16 | <-0.1> <-1.0> <0.0> <0.1> <1.0> 17 | <one>) 18 | (R -1 0 1 -0.1 -1.0 0.0 0.1 1.0 19 | <-1> <0> <1> 20 | <-0.1> <-1.0> <0.0> <0.1> <1.0> 21 | <one>) 22 | (D 1900-01-01 1950-06-15 23 | 1990 1980.5 <1906> <1907-05> <1909-08-18>) 24 | (dt 1900-01-01T11:00 1950-06-15T20:05:05 25 | 1990 1980.5 <1906> <1907-05> <1909-08-18> 26 | <1911-11-13T04> <1913-12-01T05:19> 27 | ) 28 | (S <one> <two> 29 | 3 4 5.6 -7.9 -8 1990-01-11 1995-03-15T22:30 30 | 1998-10-17T20:18:45 31 | (:55 58 46 20 31 2E 30:)) 32 | (p <one> <two> 33 | 3 4 34 | 5.6 -7.9 35 | -8 1990-01-11 36 | 1995-03-15T22:30 1998-10-17T20:18:45 37 | (:55 58 46 20 31 2E 30:) (p <a> <b>)) 38 | <should be a table> 39 | ] 40 | -------------------------------------------------------------------------------- /testdata/l59.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | =p a:int b:int 3 | =one x 4 | =two x y 5 | =three x y z 6 | { 7 | <x> { 8 | int str 9 | 1 <one> 2 <two> 10 | } 11 | <y> { 12 | int p 13 | 3 (p 4 5) 6 (p 7 8) 9 (p 10 11) 14 | } 15 | <z> { 16 | #<map z> 17 | int p 18 | 3 (p 4 5) 6 (p 7 8) 9 (p 10 11) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /testdata/l60.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | =p x:int y:int 3 | {str p 4 | <one> (#<ok> p 1 2 -3 4 5 6) 5 | <two> (#<bad> p 7 -8 9.0 10.1) 6 | <three> (#<worse> p 11 -12 <-1> <13>) 7 | <four> (#<ok2> p -7 -6) 8 | } 9 | -------------------------------------------------------------------------------- /testdata/l86.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | #<A file level > & <comment in two parts> 3 | [#<A list > & <comment in 2 parts> 4 | <A string > & <in II parts> 5 | [#<Another list > & #<comment in ii parts>] 6 | <Another string > & #<in deux parts> 7 | ] 8 | -------------------------------------------------------------------------------- /testdata/pair1.uxt: -------------------------------------------------------------------------------- 1 | uxf 1 2 | =Fraction numerator:int denominator:int 3 | =pair first second 4 | [] 5 | -------------------------------------------------------------------------------- /testdata/pair2.uxt: -------------------------------------------------------------------------------- 1 | uxf 1 2 | =pair x:int y:int 3 | {} 4 | -------------------------------------------------------------------------------- /testdata/pairimportc.uxi: -------------------------------------------------------------------------------- 1 | uxf 1 2 | !pair1.uxt 3 | !pair2.uxt 4 | (pair) 5 | -------------------------------------------------------------------------------- /testdata/pairimportd.uxi: -------------------------------------------------------------------------------- 1 | uxf 1 2 | !pair1.uxt 3 | =Fraction numerator:int denominator:int 4 | [ 5 | (pair) 6 | (Fraction) 7 | ] 8 | -------------------------------------------------------------------------------- /testdata/regression.dat.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mark-summerfield/uxf/847bfe0ded4499bfbe8eda15f1d107a94654f448/testdata/regression.dat.gz -------------------------------------------------------------------------------- /testdata/t0.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 EPD (simple dict of lists) 2 | { 3 | <Classical> [5 yes] 4 | <Modern Instrumental> [4 no] 5 | <New Acquistions> [1 no] 6 | } 7 | -------------------------------------------------------------------------------- /testdata/t1.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 EPD (simple list of lists) 2 | [ 3 | [5 <Classical> yes 1999-07-21] 4 | [4 <Modern Instrumental> no 1976-11-30] 5 | [1 <New Acquistions> no 1947-02-28] 6 | ] 7 | -------------------------------------------------------------------------------- /testdata/t14.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 TLM Config 2 | = Files Kind Filename 3 | = Categories CID Title Selected 4 | = Playlists PID Title CID Selected 5 | = IPv4 A:int B:int C:int D:int 6 | = RGB Red:int Green:int Blue:int 7 | = RGBA Red:int Green:int Blue:int Alpha:int 8 | = IntPair First:int Second:int 9 | { 10 | <General> {#<Map comment> 11 | <saved> 2022-03-21 <autosave> yes <historysize> -35 <volume> 0.7 12 | <files> (#<Table comment> Files 13 | <current> </home/mark/app/rs/tlm/PlaylistsTest.tlm> 14 | <recent1> </home/mark/app/rs/tlm/PlaylistsTest.tlm> 15 | <recent2> </home/mark/data/playlists-all.tlm> 16 | ) 17 | } 18 | <Window> {<x> 383 <y> 124 <width> 590 <height> 536 <scale> 1.1} 19 | <Magic> (:1F 8B 11 FF 0C:) 20 | <Nested Map> { 21 | <Classical> [5 yes] 22 | <Modern Instrumental> [4 no] 23 | <New Acquistions> [1 no] 24 | <Nested List of Lists> [#<List comment> 25 | [5 <Classical & <Special>> yes] 26 | [4 <Modern Instrumental> no] 27 | [1 <New Acquistions> no] 28 | ] 29 | <Map Test #1> { #<Map with different types of key> 30 | 5 6 31 | <hello> 2021-02-01 32 | 2001-01-31 <world> 33 | 1965-04-27T16:05:00 <UXF in ASCII bytes follows> 34 | (:75 78 66:) 1985-05-22T04:31:00 35 | } 36 | <Map Test #2> { #<Map same type of non-str keys> 37 | 1 <one> 2 2 3 3.0 4 (:02 20:)} 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /testdata/t15.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 Test (list of tables with dates and datetimes) 2 | #<Suitable for SQLite conversion> 3 | = Categories CID Title Selected Date:date 4 | = Playlists PID Title Cid Selected DateTime:datetime 5 | [ 6 | (Categories 7 | 5 <Classical> yes 2001-12-27 8 | 4 <Modern Instrumental> no 1973-10-18 9 | 1 <New Acquistions> no 2019-02-10 10 | 2 <Pop> no 1983-04-07 11 | 3 <Punk> no 1999-06-09 12 | 7 <Uncategorized> no 1992-02-24 13 | 6 <Unpopular Pop> no 2004-04-11 14 | ) 15 | (Playlists 16 | 4 <ABBA> 2 no 1998-09-19T23:57:59 17 | 38 <Bach> 5 no 1982-07-12T23:57:12 18 | 39 <Bartok> 5 no 1983-04-13T23:46:31 19 | 5 <Beatles> 2 no 2022-04-11T23:48:01 20 | 40 <Beethoven> 5 no 1986-06-11T23:47:25 21 | 6 <Blondie> 2 no 1995-11-23T23:56:03 22 | 52 <Bob Marley> 6 yes 1981-02-27T23:56:53 23 | 7 <Bruce Springsteen> 2 no 1995-08-10T23:56:32 24 | 41 <Chopin> 5 yes 1973-11-23T23:53:54 25 | 37 <Classical> 5 no 1992-11-18T23:57:27 26 | 8 <David Bowie> 2 no 2008-09-01T23:59:46 27 | ) 28 | ] 29 | -------------------------------------------------------------------------------- /testdata/t16.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 One Column Table 2 | = Countries Name 3 | (Countries <Netherlands> <Wales> <Belgium> <Australia> <Japan> <Ukraine>) 4 | -------------------------------------------------------------------------------- /testdata/t17.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | = Categories CID Title Selected 3 | = Playlists PID:int Title:str CID:int Selected:bool 4 | [ 5 | (Categories 6 | 5 <Classical> yes 7 | 4 <Modern Instrumental> no 8 | 1 <New Acquistions> no 9 | 2 <Pop> no 10 | 3 <Punk> no 11 | 7 <Uncategorized> no 12 | 6 <Unpopular Pop> no 13 | ) 14 | (Playlists 15 | 4 <ABBA> 2 no 16 | 38 <Bach> 5 no 17 | 39 <Bartok> 5 no 18 | 5 <Beatles> 2 no 19 | 40 <Beethoven> 5 no 20 | 6 <Blondie> 2 no 21 | 52 <Bob Marley> 6 yes 22 | 7 <Bruce Springsteen> 2 no 23 | 41 <Chopin> 5 yes 24 | 37 <Classical> 5 no 25 | 8 <David Bowie> 2 no 26 | 9 <Dire Straits> 2 no 27 | ) 28 | ] 29 | -------------------------------------------------------------------------------- /testdata/t18.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | [ 3 | [<Price List> <Date> <Price> <Quantity> <ID> <Description>] 4 | [2022-09-21 3.99 2 <CH1-A2> <Chisels (pair), 1in & 1¼in>] 5 | [2022-10-02 4.49 1 <HV2-K9> <Hammer, 2lb>] 6 | [2022-10-02 5.89 1 <SX4-D1> <Eversure Sealant, 13-floz>] 7 | ] 8 | -------------------------------------------------------------------------------- /testdata/t19.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | #<Suitable for SQLite conversion> 3 | = PriceList Date Price Quantity ID Description 4 | (PriceList 5 | 2022-09-21 3.99 2 <CH1-A2> <Chisels (pair), 1in & 1¼in> 6 | 2022-10-02 4.49 1 <HV2-K9> <Hammer, 2lb> 7 | 2022-10-02 1e1 1 <SX4-D1> <Eversure Sealant, 13-floz> 8 | ) 9 | -------------------------------------------------------------------------------- /testdata/t2.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 EPD (simple table) 2 | = Categories CID Title Selected Date 3 | (Categories 4 | 5 <Classical & <Special>> yes 1999-07-21 5 | 4 <Modern Instrumental> no 1976-11-30 6 | 1 <New Acquistions> no 1947-02-28 7 | 2 <Pop> no 1997-10-01 8 | 3 <Punk> no 2002-01-17 9 | 7 <Uncategorized> no 2020-02-02 10 | 6 <Unpopular Pop> no 2022-12-21 11 | ) 12 | -------------------------------------------------------------------------------- /testdata/t20.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | { str list 3 | <Classical> [5 yes] 4 | <Modern Instrumental> [4 no] 5 | <New Acquistions> [1 no] 6 | } 7 | -------------------------------------------------------------------------------- /testdata/t21.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | #< A little note.> 3 | [ list 4 | [5 <Classical> yes 1999-07-21] 5 | [4 <Modern Instrumental> no 1976-11-30] 6 | [1 <New Acquistions> no 1947-02-28] 7 | ] 8 | -------------------------------------------------------------------------------- /testdata/t22.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | = Categories CID:int Title:str Selected:bool Date:date 3 | (Categories 4 | 5 <Classical & <Special>> yes 1999-07-21 5 | 4 <Modern Instrumental> no 1976-11-30 6 | 1 <New Acquistions> no 1947-02-28 7 | 2 <Pop> no 1997-10-01 8 | 3 <Punk> no 2002-01-17 9 | 7 <Uncategorized> no 2020-02-02 10 | 6 <Unpopular Pop> no 2022-12-21 11 | ) 12 | -------------------------------------------------------------------------------- /testdata/t23.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | [ list 3 | [ list 4 | [5 <Classical> yes] 5 | [4 <Modern Instrumental> no] 6 | [1 <New Acquistions> no] 7 | [2 <Pop> no] 8 | [3 <Punk> no] 9 | [7 <Uncategorized> no] 10 | [6 <Unpopular Pop> no] 11 | ] 12 | [ list 13 | [4 <ABBA> 2 no] 14 | [38 <Bach> 5 no] 15 | [39 <Bartok> 5 no] 16 | [5 <Beatles> 2 no] 17 | [40 <Beethoven> 5 no] 18 | [6 <Blondie> 2 no] 19 | [52 <Bob Marley> 6 yes] 20 | [7 <Bruce Springsteen> 2 no] 21 | [41 <Chopin> 5 yes] 22 | [37 <Classical> 5 no] 23 | [8 <David Bowie> 2 no] 24 | ] 25 | ] 26 | -------------------------------------------------------------------------------- /testdata/t24.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | = Playlists PID: int Title :str CID : int Selected 3 | = Categories CID : int Title Selected :bool 4 | [table 5 | (Categories 6 | 5 <Classical> yes 7 | 4 <Modern Instrumental> no 8 | 1 <New Acquistions> no 9 | 2 <Pop> no 10 | 3 <Punk> no 11 | ? ? ? 12 | 7 <Uncategorized> no 13 | 6 <Unpopular Pop> no 14 | ) 15 | (Playlists 16 | 4 <ABBA> 2 no 17 | 38 <Bach> 5 no 18 | ? ? ? ? 19 | 39 <Bartok> 5 no 20 | 5 <Beatles> 2 no 21 | 40 <Beethoven> 5 no 22 | 6 <Blondie> 2 no 23 | 52 <Bob Marley> 6 yes 24 | 7 <Bruce Springsteen> 2 no 25 | 41 <Chopin> 5 yes 26 | 37 <Classical> 5 no 27 | 8 <David Bowie> 2 no 28 | 9 <Dire Straits> 2 no 29 | ) 30 | ] 31 | -------------------------------------------------------------------------------- /testdata/t25.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 Price List 2 | = PriceList Date:date Price:real Quantity:int ID:str Description:str 3 | (PriceList 4 | 2022-09-21 3.99 2 <CH1-A2> <Chisels (pair), 1in & 1¼in> 5 | 2022-10-02 4.49 1 <HV2-K9> <Hammer, 2lb> 6 | 2022-10-02 5.89 1 <SX4-D1> <Eversure Sealant, 13-floz> 7 | ) 8 | -------------------------------------------------------------------------------- /testdata/t26.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 MyApp 1.2.0 Config 2 | = Files Kind Filename 3 | { 4 | <General> { 5 | <shapename> <Hexagon> 6 | <zoom> 150 7 | <showtoolbar> no 8 | } 9 | <Window1> { 10 | <x> 615 11 | <y> 252 12 | <width> 592 13 | <height> 636 14 | <scale> 1.1 15 | } 16 | <Window2> { 17 | <x> 28 18 | <y> 42 19 | <width> 140 20 | <height> 81 21 | <scale> 1.0 22 | } 23 | <Window3> { 24 | <x> 57 25 | <y> 98 26 | <width> 89 27 | <height> 22 28 | <scale> 0.5 29 | } 30 | <Files> (Files 31 | <current> <test1.uxf> 32 | <recent1> </tmp/test2.uxf> 33 | <recent2> <C:\Users\mark\test3.uxf> 34 | ) 35 | } 36 | -------------------------------------------------------------------------------- /testdata/t27.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | = Files Kind Filename 3 | { str 4 | <General> { #<Map comment> str 5 | <saved> 2022-03-21 <autosave> yes <historysize> -35 <volume> 0.7 6 | <files> ( #<Table comment> Files 7 | <current> </home/mark/app/rs/tlm/PlaylistsTest.tlm> 8 | <recent1> </home/mark/app/rs/tlm/PlaylistsTest.tlm> 9 | <recent2> </home/mark/data/playlists-all.tlm> 10 | ) 11 | } 12 | <Window> { str <x> 383 <y> 124 <width> 590 <height> 536 <scale> 1.1} 13 | <Magic> (:1F 8B 11 FF 0C:) 14 | <Nested Map> { str list 15 | <Classical> [5 yes] 16 | <Modern Instrumental> [4 no] 17 | <New Acquistions> [1 no] 18 | <Nested List of Lists> [ #<List comment> list 19 | [5 <Classical & <Special>> yes] 20 | [4 <Modern Instrumental> ?] 21 | [1 <New Acquistions> no] 22 | ] 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /testdata/t28.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 TLM Config 2 | = Files Kind Filename 3 | = Categories CID:int Title Selected:bool 4 | = Playlists PID Title CID Selected 5 | = IPv4 A:int B:int C:int D:int 6 | = RGB Red:int Green:int Blue:int 7 | = RGBA Red:int Green:int Blue:int Alpha:int 8 | = IntPair First:int Second:int 9 | { 10 | <General> { 11 | <saved> 2022-03-21 <autosave> yes <historysize> -35 <volume> 0.7 12 | <files> (Files 13 | <current> </home/mark/app/rs/tlm/PlaylistsTest.tlm> 14 | <recent1> </home/mark/app/rs/tlm/PlaylistsTest.tlm> 15 | <recent2> </home/mark/data/playlists-all.tlm> 16 | ) 17 | } 18 | <Window> {<x> 383 <y> 124 <width> 590 <height> 536 <scale> 1.1} 19 | <Magic> (:1F 8B 11 0C FF:) 20 | <Nested Map> { 21 | <Classical> [5 yes] 22 | <Modern Instrumental> [4 no] 23 | <New Acquistions> [1 no] 24 | <Nested List of Lists> [ list 25 | [5 <Classical> yes] 26 | [4 <Modern Instrumental> no] 27 | [1 <New Acquistions> no] 28 | ] 29 | <Nested Table> (Categories 30 | 5 <Classical> yes 31 | 4 <Modern Instrumental> no 32 | 1 <New Acquistions> no 33 | 2 <Pop> no 34 | 3 <Punk> no 35 | 7 <Uncategorized> ? 36 | ? ? no 37 | ) 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /testdata/t29.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 TLM Config 2 | = Categories CID:int Title:str Selected:bool 3 | = Playlists PID:int Title:str CID:int Selected:bool 4 | { str list 5 | <Nested List of Tables> [ table 6 | (Categories 7 | 5 <Classical> yes 8 | 4 <Modern Instrumental> no 9 | 1 <New Acquistions> no 10 | 2 <Pop> no 11 | 3 <Punk> no 12 | 7 <Uncategorized> no 13 | 6 <Unpopular Pop> no 14 | ) 15 | (Playlists 16 | 4 <ABBA> 2 no 17 | 38 <Bach> 5 no 18 | 39 <Bartok> 5 no 19 | 5 <Beatles> 2 no 20 | 40 <Beethoven> 5 no 21 | 6 <Blondie> 2 no 22 | 52 <Bob Marley> 6 yes 23 | 7 <Bruce Springsteen> 2 no 24 | 41 <Chopin> 5 yes 25 | 37 <Classical> 5 no 26 | 8 <David Bowie> 2 no 27 | 9 <Dire Straits> 2 no 28 | ) 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /testdata/t3.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 EPD (list of lists of lists) 2 | [ 3 | [ 4 | [5 <Classical> yes] 5 | [4 <Modern Instrumental> no] 6 | [1 <New Acquistions> no] 7 | [2 <Pop> no] 8 | [3 <Punk> no] 9 | [7 <Uncategorized> no] 10 | [6 <Unpopular Pop> no] 11 | ] 12 | [ 13 | [4 <ABBA> 2 no] 14 | [38 <Bach> 5 no] 15 | [39 <Bartok> 5 no] 16 | [5 <Beatles> 2 no] 17 | [40 <Beethoven> 5 no] 18 | [6 <Blondie> 2 no] 19 | [52 <Bob Marley> 6 yes] 20 | [7 <Bruce Springsteen> 2 no] 21 | [41 <Chopin> 5 yes] 22 | [37 <Classical> 5 no] 23 | [8 <David Bowie> 2 no] 24 | ] 25 | ] 26 | -------------------------------------------------------------------------------- /testdata/t30.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 MyApp 1.2.0 Config 2 | = pos x:int y:int 3 | = size width:int height:int 4 | { 5 | <General> { #<Miscellaneous settings> 6 | <shapename> <Hexagon> <zoom> 150 <showtoolbar> no <Files> { 7 | <current> <test1.uxf> 8 | <recent> [ #<From most to least recent> 9 | </tmp/test2.uxf> <C:\Users\mark\test3.uxf>] 10 | } 11 | } 12 | <Window1> { #<Window dimensions and scales> str 13 | <pos> (pos 615 252) 14 | <size> (size 592 636) 15 | <scale> 1.1 16 | } 17 | <Window2> { 18 | <pos> (pos 28 42) 19 | <size> (size 140 81) 20 | <scale> 1.0 21 | } 22 | <Window3> { 23 | <pos> (pos 57 98) 24 | <size> (size 89 22) 25 | <scale> 0.5 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /testdata/t32.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 MyApp 1.2.0 Config 2 | = #<nonnegative> pos x:int y:int 3 | = #<nonnegative & > 0> size width:int height:int 4 | { #<Notes on this configuration file format> str map 5 | <General> { #<Miscellaneous settings> str 6 | <shapename> <Hexagon> <zoom> 150 <showtoolbar> no <Files> { str 7 | <current> <test1.uxf> 8 | <recent> [ #<From most to least recent> str 9 | </tmp/test2.uxf> <C:\Users\mark\test3.uxf>] 10 | } 11 | } 12 | <Windows> { #<Window dimensions and scales> 13 | <pos> (pos 615 252 28 42 57 98) 14 | <size> (size 592 636 140 81 89 22) 15 | <scale> [1.1 1.0 0.5] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /testdata/t33.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 MyApp 1.2.0 Config 2 | = #<Window dimensions> Geometry x:int y:int width:int height:int scale:real 3 | { #<Notes on this configuration file format> str map 4 | <General> { #<Miscellaneous settings> str 5 | <shapename> <Hexagon> <zoom> 150 <showtoolbar> no <Files> { str 6 | <current> <test1.uxf> 7 | <recent> [ #<From most to least recent> str 8 | </tmp/test2.uxf> <C:\Users\mark\test3.uxf> ?] 9 | } 10 | } 11 | <Windows> (#<Window dimensions and scales> Geometry 12 | 615 252 592 636 1.1 13 | 28 42 140 81 1.0 14 | 57 98 89 22 0.5 15 | ? ? ? ? ? 16 | ) 17 | } 18 | -------------------------------------------------------------------------------- /testdata/t34.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 TLM Config 2 | { str map 3 | <Map Test #1> {#<Map with different types of key> 4 | 5 6 5 | <hello> 2021-02-01 6 | 2001-01-31 <world> 7 | 1965-04-27T16:05:00 <UXF in ASCII bytes follows> 8 | (:75 78 66:) 1985-05-22T04:31:00 9 | } 10 | <Map Test #2> { #<Map same type of non-str keys> int 11 | 1 <one> 2 2 3 3.0 4 (:02 20:)} 12 | <Map Test #3> { #<Map same type of non-str keys and values> int date 13 | 5 2001-12-27 14 | 4 1973-10-18 15 | 1 2019-02-10 16 | 2 1983-04-07 17 | 3 1999-06-09 18 | 7 1992-02-24 19 | 6 2004-04-11 20 | } 21 | <Map Test #4> { 22 | 2001-12-27 5 23 | 1973-10-18 4 24 | 2019-02-10 1 25 | 1983-04-07 2 26 | 1999-06-09 3 27 | 1992-02-24 7 28 | 2004-04-11 6 29 | } 30 | <Map Test #5> { 31 | 2001-12-27 5 32 | 1973-10-18 4 33 | 2019-02-10 1 34 | 1983-04-07 2 35 | 1999-06-09 3 36 | 1992-02-24 7 37 | 2004-04-11 6 38 | } 39 | <Map Test #6> { date 40 | 2001-12-27 5 41 | 1973-10-18 4 42 | 2019-02-10 1 43 | 1983-04-07 2 44 | 1999-06-09 3 45 | 1992-02-24 7 46 | 2004-04-11 6 47 | } 48 | <Map Test #7> { date int 49 | 2001-12-27 5 50 | 1973-10-18 4 51 | 2019-02-10 1 52 | 1983-04-07 2 53 | 1999-06-09 3 54 | 1992-02-24 7 55 | 2004-04-11 6 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /testdata/t35.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | #<Suitable for SQLite conversion> 3 | = Categories CID:int title:str selected:bool when:date 4 | = Playlists PID:int title cid:int selected:bool timestamp:datetime 5 | [ 6 | (Categories 7 | 5 <Classical> yes 2001-12-27 8 | 4 <Modern Instrumental> no 1973-10-18 9 | 1 <New Acquistions> no 2019-02-10 10 | 2 <Pop> no 1983-04-07 11 | 3 <Punk> no 1999-06-09 12 | 7 <Uncategorized> no 1992-02-24 13 | 6 <Unpopular Pop> no 2004-04-11 14 | ) 15 | (Playlists 16 | 4 <ABBA> 2 no 1998-09-19T23:57:59 17 | 38 <Bach> 5 no 1982-07-12T23:57:12 18 | 39 <Bartok> 5 no 1983-04-13T23:46:31 19 | 5 <Beatles> 2 no 2022-04-11T23:48:01 20 | 40 <Beethoven> 5 no 1986-06-11T23:47:25 21 | 6 <Blondie> 2 no 1995-11-23T23:56:03 22 | 52 <Bob Marley> 6 yes 1981-02-27T23:56:53 23 | 7 <Bruce Springsteen> 2 no 1995-08-10T23:56:32 24 | 41 <Chopin> 5 yes 1973-11-23T23:53:54 25 | 37 <Classical> 5 no 1992-11-18T23:57:27 26 | 8 <David Bowie> 2 no 2008-09-01T23:59:46 27 | ) 28 | ] 29 | -------------------------------------------------------------------------------- /testdata/t36.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 MyApp Data 2 | #<Suitable for SQLite conversion> 3 | = Customers CID Company Address Contact Email 4 | = Invoices INUM CID Raised_Date Due_Date Paid Description 5 | = Items IID INUM Delivery_Date Unit_Price Quantity Description 6 | [ #<There is a 1:M relationship between the Invoices and Items tables> 7 | (Customers 8 | 50 <Best People> <123 Somewhere> <John Doe> <j@doe.com> 9 | 19 <Supersuppliers> <The Square> <Jane Doe> <jane@super.com> 10 | ? ? ? ? ? 11 | ) 12 | (Invoices 13 | 152 50 2022-01-17 2022-02-17 no <COD> 14 | ? ? ? ? ? ? 15 | 153 19 2022-01-19 2022-02-19 yes <> 16 | ) 17 | (Items 18 | ? ? ? ? ? ? 19 | 1839 152 2022-01-16 29.99 2 <Bales of hay> 20 | 1840 152 2022-01-16 5.98 3 <Straps> 21 | 1620 153 2022-01-19 11.5 1 <Washers (1-in)> 22 | ) 23 | ] 24 | -------------------------------------------------------------------------------- /testdata/t37.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 MyApp Data 2 | #<Suitable for SQLite conversion> 3 | = Customers CID:int Company:str Address:str Contact:str Email:str 4 | = Invoices INUM:int CID:int Raised_Date:date Due_Date:date Paid:bool Description:str 5 | = Items IID:int INUM:int Delivery_Date:date Unit_Price:real Quantity:int Description:str 6 | [ #<There is a 1:M relationship between the Invoices and Items tables> 7 | (Customers 8 | 50 <Best People> <123 Somewhere> <John Doe> <j@doe.com> 9 | 19 <Supersuppliers> ? <Jane Doe> <jane@super.com> 10 | ) 11 | (Invoices 12 | 152 50 2022-01-17 2022-02-17 no <COD> 13 | 153 19 2022-01-19 2022-02-19 yes <> 14 | ) 15 | (Items 16 | 1839 152 2022-01-16 29.99 2 <Bales of hay> 17 | 1840 152 2022-01-16 5.98 3 <Straps> 18 | 1620 153 2022-01-19 11.5 1 <Washers (1-in)> 19 | ) 20 | ] 21 | -------------------------------------------------------------------------------- /testdata/t39.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | = Pair First Second 3 | = Triple First Second Third 4 | [ #<Nested tables> 5 | (Pair (Pair 17 21) (Pair 98 65)) 6 | (Triple (Pair <a> <b>) (Triple 2020-01-17 2020-02-18 2021-12-05) (Pair ? no) 7 | 1 2 3 <x> <y> (Pair)) 8 | ] 9 | -------------------------------------------------------------------------------- /testdata/t4.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 EPD (list of tables) 2 | = Categories CID Title Selected 3 | = Playlists PID Title CID Selected 4 | [ 5 | (Categories 6 | 5 <Classical> yes 7 | 4 <Modern Instrumental> no 8 | 1 <New Acquistions> no 9 | 2 <Pop> no 10 | 3 <Punk> no 11 | ? ? ? 12 | 7 <Uncategorized> no 13 | 6 <Unpopular Pop> no 14 | ) 15 | (Playlists 16 | 4 <ABBA> 2 no 17 | 38 <Bach> 5 no 18 | 39 <Bartok> 5 no 19 | 5 <Beatles> 2 no 20 | 40 <Beethoven> 5 no 21 | 6 <Blondie> 2 no 22 | 52 <Bob Marley> 6 yes 23 | 7 <Bruce Springsteen> 2 no 24 | 41 <Chopin> 5 yes 25 | ? ? ? ? 26 | 37 <Classical> 5 no 27 | 8 <David Bowie> 2 no 28 | 9 <Dire Straits> 2 no 29 | ) 30 | ] 31 | -------------------------------------------------------------------------------- /testdata/t40.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | = Pair First Second 3 | (Pair 1 2 3 4 5 6 7 8 9 10) 4 | -------------------------------------------------------------------------------- /testdata/t41.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | = Pair First Second 3 | (Pair 1 2 3 4 5 6 7 8 [8.6] 10) 4 | -------------------------------------------------------------------------------- /testdata/t42.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | = Pair First:int Second:int 3 | (Pair 1 2 3 4 5 6 7 8 9 10) 4 | -------------------------------------------------------------------------------- /testdata/t43.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | = Pair First:int Second:list 3 | (Pair 1 [] 2 [<a> <b>] 3 [9.8 7.1]) 4 | -------------------------------------------------------------------------------- /testdata/t44.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 TLM Config 2 | = IntPair First:int Second:int 3 | = IntQuad First:IntPair Second:IntPair 4 | [ 5 | (IntPair 1 2) 6 | (IntQuad (IntPair 1 2) (IntPair 3 4)) 7 | (IntQuad 8 | (IntPair 1 2) (IntPair 3 4) 9 | (IntPair 5 6) (IntPair 7 8) 10 | (IntPair 9 10) (IntPair 11 12) 11 | ) 12 | ] 13 | -------------------------------------------------------------------------------- /testdata/t45.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | = Pair First Second 3 | = Quad First:Pair Second:Pair 4 | [ 5 | (Quad (Pair 1 2) (Pair 3 4)) 6 | (Quad (Pair 1 2) (Pair 3 4) (Pair 5 6) (Pair 7 8) (Pair 9 10) (Pair 11 12)) 7 | ] 8 | -------------------------------------------------------------------------------- /testdata/t47.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 MyApp Data 2 | #<A hierarchical alternative to some foreign key IDs. 3 | We've kept Customers as-is because different invoices may be for the same 4 | customer.> 5 | = Customers CID:int Company:str Address:str Contact:str Email:str 6 | = Invoices INUM:int CID:int Raised_Date:date Due_Date:date Paid:bool Description:str Items:Items 7 | = Items IID:int Delivery_Date:date Unit_Price:real Quantity:int Description:str 8 | [ #<There is a 1:M relationship between the Invoices and Items tables> 9 | (Customers 10 | 50 <Best People> <123 Somewhere> <John Doe> <j@doe.com> 11 | 19 <Supersuppliers> ? <Jane Doe> <jane@super.com> 12 | ) 13 | (Invoices 14 | 152 50 2022-01-17 2022-02-17 no <COD> (Items 15 | 1839 2022-01-16 29.99 2 <Bales of hay> 16 | 1840 2022-01-16 5.98 3 <Straps> 17 | ) 18 | 153 19 2022-01-19 2022-02-19 yes <> (Items 19 | 1620 2022-01-19 11.5 1 <Washers (1-in)> 20 | ) 21 | ) 22 | ] 23 | -------------------------------------------------------------------------------- /testdata/t48.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | [] 3 | -------------------------------------------------------------------------------- /testdata/t49.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 My Custom Format 2 | [] 3 | -------------------------------------------------------------------------------- /testdata/t50.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | #<File-level comment> 3 | [] 4 | -------------------------------------------------------------------------------- /testdata/t51.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 My Custom Format 2 | #<Another file-level comment> 3 | {} 4 | -------------------------------------------------------------------------------- /testdata/t52.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | = Pair first:int second:int 3 | (Pair) 4 | -------------------------------------------------------------------------------- /testdata/t53.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 My Custom Format 2 | = Pair first:real second:real 3 | (Pair) 4 | -------------------------------------------------------------------------------- /testdata/t54.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | #<File-level comment> 3 | = Pair first:str second:str 4 | {} 5 | -------------------------------------------------------------------------------- /testdata/t55.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 My Custom Format 2 | #<Another file-level comment> 3 | = Pair first second 4 | [] 5 | -------------------------------------------------------------------------------- /testdata/t6.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 TLM Config 2 | = Files Kind Filename 3 | { 4 | <General> { 5 | <saved> 2022-03-21 <autosave> yes <historysize> -35 <volume> 0.7 6 | <files> (Files 7 | <current> </home/mark/app/rs/tlm/PlaylistsTest.tlm> 8 | <recent1> </home/mark/app/rs/tlm/PlaylistsTest.tlm> 9 | <recent2> </home/mark/data/playlists-all.tlm> 10 | ) 11 | } 12 | <Window> {<x> 383 <y> 124 <width> 590 <height> 536 <scale> 1.1} 13 | <Magic> (:1F 8B:) 14 | } 15 | -------------------------------------------------------------------------------- /testdata/t61.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | = img content image:bytes 3 | = p content 4 | = b content 5 | [ 6 | (p <first para>) 7 | (p (img (b <bold caption>) (:B445:))) 8 | ] 9 | -------------------------------------------------------------------------------- /testdata/t62.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 TLM Config 2 | ! ttype-test.uxi 3 | = point x:int y:int z:int 4 | = Files Kind Filename 5 | { 6 | <files> (Files 7 | <current> </home/mark/app/rs/tlm/PlaylistsTest.tlm> 8 | <recent1> </home/mark/app/rs/tlm/PlaylistsTest.tlm> 9 | <recent2> </home/mark/data/playlists-all.tlm> 10 | ) 11 | <More Tests> [#<A list of name value pairs; normally would be a map> 12 | <one> (IPv4 141 179 19 9) 13 | <many> (IPv4 14 | 172 16 254 1 15 | 192 0 2 235 16 | 127 0 0 1) 17 | <red> (rgb 255 0 0) 18 | <semi-transparent blue> (rgba 0 0 255 80) 19 | <points> (point -1 2 3 -4 5 6 -7 8 9) 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /testdata/t63.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | !http://localhost:5558/ttype-eg.uxf 3 | !ttype-test.uxi 4 | !complex 5 | !fraction 6 | !t63.uxt 7 | =point3d x:int y:int z:int 8 | =dob dob:date 9 | [ 10 | (img (rgb 0 0 127) (:DECADE:)) 11 | (i <is this oblique?>) 12 | { 13 | 10 (point3d 3 4 5 5 12 13 8 15 17 7 24 25) 14 | 20 (cmyk 0.9 0.9 0.5 0.0) 15 | 30 (pair <one> 2) 16 | } 17 | (Complex 3.9 -1.4 -0.17e3 2e-5) 18 | (Fraction 22 7) 19 | ] 20 | -------------------------------------------------------------------------------- /testdata/t63.uxt: -------------------------------------------------------------------------------- 1 | uxf 1 2 | =cmyk cyan:real magenta:real yellow:real black:real 3 | =point2d x:int y:int 4 | [] 5 | -------------------------------------------------------------------------------- /testdata/t63r.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | =cmyk cyan:real magenta:real yellow:real black:real 3 | =Complex Real:real Imag:real 4 | =dob dob:date 5 | =Fraction numerator:int denominator:int 6 | =#<italic> i content 7 | =#<image> img content image:bytes 8 | =#<a pair of any two values> pair first second 9 | =point3d x:int y:int z:int 10 | =#<0-255 per component> rgb red:int green:int blue:int 11 | [ 12 | (img (rgb 0 0 127) (:DECADE:)) 13 | (i <is this oblique?>) 14 | { 15 | 10 (point3d 16 | 3 4 5 17 | 5 12 13 18 | 8 15 17 19 | 7 24 25 20 | ) 21 | 20 (cmyk 0.9 0.9 0.5 0.0) 22 | 30 (pair <one> 2) 23 | } 24 | (Complex 25 | 3.9 -1.4 26 | -170.0 2e-05 27 | ) 28 | (Fraction 22 7) 29 | ] 30 | -------------------------------------------------------------------------------- /testdata/t7.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 TLM Config 2 | = Files Kind Filename 3 | { 4 | <General> {#<Map comment> 5 | <saved> 2022-03-21 <autosave> yes <historysize> -35 <volume> 0.7 6 | <files> (#<Table comment> Files 7 | <current> </home/mark/app/rs/tlm/PlaylistsTest.tlm> 8 | <recent1> </home/mark/app/rs/tlm/PlaylistsTest.tlm> 9 | <recent2> </home/mark/data/playlists-all.tlm> 10 | ) 11 | } 12 | <Window> {<x> 383 <y> 124 <width> 590 <height> 536 <scale> 1.1} 13 | <Magic> (:1F 8B:) 14 | <Nested Map> { 15 | <Classical> [5 yes] 16 | <Modern Instrumental> [4 no] 17 | <New Acquistions> [1 no] 18 | <Nested List of Lists> [#<List comment> 19 | [5 <Classical & <Special>> yes] 20 | [4 <Modern Instrumental> no] 21 | [1 <New Acquistions> ?] 22 | ] 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /testdata/t70.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | =Pair first second 3 | (Pair (Pair 1 2) (Pair 3 (Pair 4 5))) 4 | -------------------------------------------------------------------------------- /testdata/t71.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | =Roman 3 | =Decimal 4 | =p x y 5 | [ 6 | (Roman) 7 | (Decimal) 8 | (Decimal) 9 | [p (p 1 2)] 10 | ] 11 | -------------------------------------------------------------------------------- /testdata/t72.uxi: -------------------------------------------------------------------------------- 1 | uxf 1 2 | !http://localhost:5558/ttype-eg.uxf 3 | !ttype-test.uxi 4 | !complex 5 | !fraction 6 | !t63.uxt 7 | =point3d x:int y:int z:int 8 | =dob dob:date 9 | [ 10 | (:DECADE:) 11 | <is that so?> 12 | { 13 | 10 [3 4 5] 14 | 20 0.9 15 | 30 <A one> 16 | } 17 | ] 18 | -------------------------------------------------------------------------------- /testdata/t73.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | =T a b c d e f 3 | [ 4 | {<one> 1} 5 | {str <two> 2} 6 | {str <a> (T 1 2 3 4 5 6) <b> (T 1 2 3 4 5 6) <c> (T 1 2 3 4 5 6)} 7 | {str int <three> 3} 8 | {str T <a> (T 1 2 3 4 5 6) <b> (T 1 2 3 4 5 6) <c> (T 1 2 3 4 5 6)} 9 | [str <one>] 10 | ] 11 | -------------------------------------------------------------------------------- /testdata/t74.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 MyApp Data 2 | #<A hierarchical alternative to some foreign key IDs. 3 | We've kept Customers as-is because different invoices may be for the same 4 | customer.> 5 | = Database customers:Customers invoices:Invoices 6 | = Customers CID:int Company:str Address:str Contact:str Email:str 7 | = Invoices INUM:int CID:int Raised_Date:date Due_Date:date Paid:bool Description:str Items:Items 8 | = Items IID:int Delivery_Date:date Unit_Price:real Quantity:int Description:str 9 | (#<There is a 1:M relationship between the Invoices and Items tables> Database 10 | (Customers 11 | 50 <Best People> <123 Somewhere> <John Doe> <j@doe.com> 12 | 19 <Supersuppliers> ? <Jane Doe> <jane@super.com> 13 | ) 14 | (Invoices 15 | 152 50 2022-01-17 2022-02-17 no <COD> (Items 16 | 1839 2022-01-16 29.99 2 <Bales of hay> 17 | 1840 2022-01-16 5.98 3 <Straps> 18 | ) 19 | 153 19 2022-01-19 2022-02-19 yes <> (Items 20 | 1620 2022-01-19 11.5 1 <Washers (1-in)> 21 | ) 22 | ) 23 | ) 24 | -------------------------------------------------------------------------------- /testdata/t75.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | !numeric 3 | [ 4 | (Complex 3.9 -1.4 -0.17e3 2e-5) 5 | (Fraction 22 7) 6 | ] 7 | -------------------------------------------------------------------------------- /testdata/t77.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 Map comparison test 2 | #<t77.uxf == t78.uxf even though maps have different orders> 3 | = IPv4 A:int B:int C:int D:int 4 | = #<0-255 per component> rgb red:int green:int blue:int 5 | = #<0-255 per component> rgba red:int green:int blue:int alpha:int 6 | { 7 | <General> { 8 | <saved> 2022-03-21 9 | <autosave> yes 10 | <historysize> -35 11 | <volume> 0.7 12 | <files> { 13 | <current> </home/mark/app/rs/tlm/PlaylistsTest.tlm> 14 | <recent1> </home/mark/app/rs/tlm/PlaylistsTest.tlm> 15 | <recent2> </home/mark/data/playlists-all.tlm> 16 | } 17 | } 18 | <Window> {<pos> [383 124] <size> [590 536] <scale> 1.1} 19 | <More Tests> { 20 | <one> (IPv4 141 179 19 9) 21 | <many> (IPv4 22 | 172 16 254 1 23 | 192 0 2 235 24 | 127 0 0 1) 25 | <red> (rgb 255 0 0) 26 | <semi-transparent blue> (rgba 0 0 255 80) 27 | } 28 | <Magic> (:1F 8B:) 29 | <Nested Map> { 30 | <Classical> [5 yes] 31 | <Modern Instrumental> [4 no] 32 | <New Acquistions> [1 no] 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /testdata/t78.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 Map comparison test 2 | #<t77.uxf == t78.uxf even though maps have different orders> 3 | = IPv4 A:int B:int C:int D:int 4 | = #<0-255 per component> rgb red:int green:int blue:int 5 | = #<0-255 per component> rgba red:int green:int blue:int alpha:int 6 | { 7 | <Window> {<scale> 1.1 <pos> [383 124] <size> [590 536] } 8 | <More Tests> { 9 | <red> (rgb 255 0 0) 10 | <many> (IPv4 11 | 172 16 254 1 12 | 192 0 2 235 13 | 127 0 0 1) 14 | <semi-transparent blue> (rgba 0 0 255 80) 15 | <one> (IPv4 141 179 19 9) 16 | } 17 | <Magic> (:1F 8B:) 18 | <Nested Map> { 19 | <Modern Instrumental> [4 no] 20 | <New Acquistions> [1 no] 21 | <Classical> [5 yes] 22 | } 23 | <General> { 24 | <volume> 0.7 25 | <files> { 26 | <recent2> </home/mark/data/playlists-all.tlm> 27 | <current> </home/mark/app/rs/tlm/PlaylistsTest.tlm> 28 | <recent1> </home/mark/app/rs/tlm/PlaylistsTest.tlm> 29 | } 30 | <historysize> -35 31 | <saved> 2022-03-21 32 | <autosave> yes 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /testdata/t79.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 Custom text 2 | #<File level comment> 3 | = IPv4 A:int B:int C:int D:int 4 | = #<0-255 per component> rgb red:int green:int blue:int 5 | = #<0-255 per component> rgba red:int green:int blue:int alpha:int 6 | { 7 | <General> {#<Map comment> 8 | <saved> 2022-03-21 9 | <autosave> yes 10 | <historysize> -35 11 | <volume> 0.7 12 | <files> { 13 | <current> </home/mark/app/rs/tlm/PlaylistsTest.tlm> 14 | <recent1> </home/mark/app/rs/tlm/PlaylistsTest.tlm> 15 | <recent2> </home/mark/data/playlists-all.tlm> 16 | } 17 | } 18 | <Window> {<pos> [383 124] <size> [590 536] <scale> 1.1} 19 | <More Tests> { 20 | <one> (IPv4 141 179 19 9) 21 | <many> (#<Table comment> IPv4 22 | 172 16 254 1 23 | 192 0 2 235 24 | 127 0 0 1) 25 | <red> (rgb 255 0 0) 26 | <semi-transparent blue> (rgba 0 0 255 80) 27 | } 28 | <Magic> (:1F 8B:) 29 | <Nested Map> { 30 | <Classical> [5 yes] 31 | <Modern Instrumental> [#<List comment> 4 no] 32 | <New Acquistions> [1 no] 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /testdata/t8.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 TLM Config 2 | #<A single comment may be placed at the start after the uxf header and 3 | before evertthing else.> 4 | = Files Kind Filename 5 | = Categories CID Title Selected 6 | { 7 | <General> { 8 | <saved> 2022-03-21 <autosave> yes <historysize> -35 <volume> 0.7 9 | <files> (Files 10 | <current> </home/mark/app/rs/tlm/PlaylistsTest.tlm> 11 | <recent1> </home/mark/app/rs/tlm/PlaylistsTest.tlm> 12 | <recent2> </home/mark/data/playlists-all.tlm> 13 | ) 14 | } 15 | <Window> {<x> 383 <y> 124 <width> 590 <height> 536 <scale> 1.1} 16 | <Magic> (:1F 8B:) 17 | <Nested Dict> { 18 | <Classical> [5 yes] 19 | <Modern Instrumental> [4 no] 20 | <New Acquistions> [1 no] 21 | <Nested List of Lists> [ 22 | [5 <Classical> yes] 23 | [4 <Modern Instrumental> no] 24 | [1 <New Acquistions> no] 25 | ] 26 | <Nested Table> (Categories 27 | 5 <Classical> yes 28 | 4 <Modern Instrumental> no 29 | 1 <New Acquistions> no 30 | 2 <Pop> no 31 | 3 <Punk> ? 32 | ? ? no 33 | 6 <Unpopular Pop> no 34 | ) 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /testdata/t80.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | #<last modified 1 April 2001 by John Doe> 3 | { 4 | <owner> {<name> <John Doe> <organization> <Acme Widgets Inc.>} 5 | <database> 6 | {#<use IP address in case network name resolution is not working> 7 | <server> <192.0.2.62> 8 | <port> 143 9 | <file> <payroll.dat> 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /testdata/t81.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | #<last modified 1 April 2001 by John Doe> 3 | =Owner name:str organization:str 4 | =#<use IP address in case network name resolution is not working> 5 | Database server:str port:int file:str 6 | [ 7 | (Owner <John Doe> <Acme Widgets Inc.>) 8 | (Database <192.0.2.62> 143 <payroll.dat>) 9 | ] 10 | -------------------------------------------------------------------------------- /testdata/t82.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | =Feature geometry properties:map 3 | =LineString x:real y:real 4 | =Point x:real y:real 5 | =Polygon x:real y:real 6 | (Feature 7 | (Point 102.0 0.5) {<prop0> <value0>} 8 | (LineString 102.0 0.0 103.0 1.0 104.0 0.0 105.0 1.0) 9 | {<prop0> <value0> <prop1> 0.0} 10 | (Polygon 100.0 0.0 101.0 0.0 101.0 1.0 100.0 1.0 100.0 0.0) 11 | {<prop0> <value0> <prop1> {<this> <that>}} 12 | ) 13 | -------------------------------------------------------------------------------- /testdata/t83.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | #<UXF version of TOML Example> 3 | =DateTime base:datetime offset:str 4 | =Owner name:str dob:DateTime 5 | =Database server:str ports:list connection_max:int enabled:bool 6 | =Server name:str ip:str dc:str 7 | =Clients a b 8 | =Hosts name:str 9 | [ 10 | (Owner <Tom Preston-Werner> (DateTime 1979-05-27T07:32:00 <-08:00>)) 11 | (Database <192.168.1.1> [8000 8001 8002] 5000 yes) 12 | (Server <alpha> <10.0.0.1> <eqdc10> 13 | <beta> <10.0.0.2> <eqdc10>) 14 | (Clients <gamma> <delta> 1 2) 15 | (Hosts 16 | <alpha> 17 | <omega>) 18 | ] 19 | -------------------------------------------------------------------------------- /testdata/t84.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | #<File level > & 3 | <comment > & 4 | <for testing > & 5 | <string concatenation > & 6 | <with the & operator.> 7 | =#<ttype comment > & 8 | <for tests> A a 9 | [#<list comment >& 10 | <for a list long comment > & 11 | <test> 12 | (#<table comment > & 13 | <as another test> A <an imaginary very long > & 14 | <string to test string concatenation> (:AB 01 54 70 15 | 81 40 48 58 99 F0 16 | 65 20 21 22:)) 17 | {#<map comment >&<to test map comments>} 18 | ] 19 | -------------------------------------------------------------------------------- /testdata/t86.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 2 | =Feature geometry properties:map 3 | =LineString points:Point 4 | =Point x:real y:real 5 | =Polygon points:Point 6 | (Feature 7 | (Point 102.0 0.5) {<prop0> <value0>} 8 | (LineString (Point 102.0 0.0 103.0 1.0 104.0 0.0 105.0 1.0)) 9 | {<prop0> <value0> <prop1> 0.0} 10 | (Polygon (Point 100.0 0.0 101.0 0.0 101.0 1.0 100.0 1.0 100.0 0.0)) 11 | {<prop0> <value0> <prop1> {<this> <that>}} 12 | ) 13 | -------------------------------------------------------------------------------- /testdata/t9.uxf: -------------------------------------------------------------------------------- 1 | uxf 1 TLM Config 2 | = Categories CID Title Selected 3 | = Playlists PID Title CID Selected 4 | { 5 | <Nested List of Tables> [ 6 | (Categories 7 | 5 <Classical> yes 8 | 4 <Modern Instrumental> no 9 | 1 <New Acquistions> no 10 | 2 <Pop> no 11 | 3 <Punk> no 12 | 7 <Uncategorized> no 13 | 6 <Unpopular Pop> no 14 | ) 15 | (Playlists 16 | 4 <ABBA> 2 no 17 | 38 <Bach> 5 no 18 | 39 <Bartok> 5 no 19 | 5 <Beatles> 2 no 20 | 40 <Beethoven> 5 no 21 | 6 <Blondie> 2 no 22 | 52 <Bob Marley> 6 yes 23 | 7 <Bruce Springsteen> 2 no 24 | 41 <Chopin> 5 yes 25 | 37 <Classical> 5 no 26 | 8 <David Bowie> 2 no 27 | 9 <Dire Straits> 2 no 28 | ) 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /testdata/tlm-eg1.uxx.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mark-summerfield/uxf/847bfe0ded4499bfbe8eda15f1d107a94654f448/testdata/tlm-eg1.uxx.gz -------------------------------------------------------------------------------- /testdata/tlm-eg2.uxx.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mark-summerfield/uxf/847bfe0ded4499bfbe8eda15f1d107a94654f448/testdata/tlm-eg2.uxx.gz -------------------------------------------------------------------------------- /testdata/ttype-test.uxi: -------------------------------------------------------------------------------- 1 | uxf 1 2 | #<An example of a system ttype definitions file used for testing.> 3 | = IPv4 A:int B:int C:int D:int 4 | = #<0-255 per component> rgb red:int green:int blue:int 5 | = #<0-255 per component> rgba red:int green:int blue:int alpha:int 6 | = #<a pair of any two values> pair first second 7 | [] 8 | -------------------------------------------------------------------------------- /x/rs/.rustfmt.toml: -------------------------------------------------------------------------------- 1 | edition = "2021" 2 | max_width = 76 3 | # comment_width = 76 4 | use_small_heuristics = "Max" 5 | use_field_init_shorthand = true 6 | # wrap_comments = true 7 | # fn_args_density = "Compressed" 8 | # format_strings = true 9 | # merge_imports = true 10 | # reorder_impl_items = true 11 | -------------------------------------------------------------------------------- /x/rs/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "anyhow" 7 | version = "1.0.64" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "b9a8f622bcf6ff3df478e9deba3e03e4e04b300f8e6a139e192c05fa3490afc7" 10 | 11 | [[package]] 12 | name = "x" 13 | version = "0.1.0" 14 | dependencies = [ 15 | "anyhow", 16 | ] 17 | -------------------------------------------------------------------------------- /x/rs/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "x" 3 | version = "0.16.2" 4 | edition = "2021" 5 | 6 | [dependencies] 7 | anyhow = "1" 8 | 9 | [profile.release] 10 | strip = true 11 | opt-level = 3 12 | lto = true 13 | -------------------------------------------------------------------------------- /x/x.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | B = -1 # list begin 4 | E = -2 # list end 5 | 6 | 7 | def main(): 8 | tokens = [B, 1, 2, B, 30, 40, B, 500, B, E, E, 70, B, 800, 900, E, 9 | 1000, E, 1100, E] 10 | assert tokens.count(B) == tokens.count(E) 11 | expected = [1, 2, [30, 40, [500, []], 70, [800, 900], 1000], 1100] 12 | actual = parse(tokens) 13 | print('Actual ', actual) 14 | print('Expected', expected) 15 | assert actual == expected 16 | 17 | 18 | # My algorithm (20 LOC) 19 | def parse(tokens): 20 | value = None 21 | stack = [] 22 | for token in tokens: 23 | if token == B: 24 | lst = [] 25 | if value is None: 26 | value = lst 27 | stack.append(value) 28 | else: 29 | top = stack[-1] 30 | if isinstance(top, list): 31 | top.append(lst) # add new list to current list 32 | stack.append(lst) # make new list the current list 33 | elif token == E: 34 | stack.pop() 35 | else: 36 | top = stack[-1] 37 | top.append(token) 38 | return value 39 | 40 | 41 | if __name__ == '__main__': 42 | main() 43 | -------------------------------------------------------------------------------- /x/xx.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | B = -1 # list begin 4 | E = -2 # list end 5 | 6 | 7 | def main(): 8 | tokens = [B, 1, 2, B, 30, 40, B, 500, B, E, E, 70, B, 800, 900, E, 9 | 1000, E, 1100, E] 10 | assert tokens.count(B) == tokens.count(E) 11 | expected = [1, 2, [30, 40, [500, []], 70, [800, 900], 1000], 1100] 12 | actual = parse(tokens) 13 | print('Actual ', actual) 14 | print('Expected', expected) 15 | assert actual == expected 16 | 17 | 18 | # rust forum's 2e71828's algorithm (19 LOC) 19 | def parse(tokens): 20 | value = None 21 | stack = [] 22 | for token in tokens: 23 | if value is not None: 24 | element = value 25 | value = None 26 | if stack: 27 | top = stack[-1] 28 | if isinstance(top, list): 29 | top.append(element) 30 | if token == B: 31 | stack.append([]) 32 | value = None 33 | elif token == E: 34 | value = stack.pop() 35 | else: 36 | value = token 37 | return value 38 | 39 | 40 | if __name__ == '__main__': 41 | main() 42 | --------------------------------------------------------------------------------