Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop the package system #369

Open
wants to merge 314 commits into
base: dev-0-1-0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
314 commits
Select commit Hold shift + click to select a range
5998011
move 'footnote-scheme'
gfngfn Nov 2, 2022
9dac222
move 'proof'
gfngfn Nov 2, 2022
c509f94
move 'md-ja'
gfngfn Nov 2, 2022
86a1a17
move 'std-ja{,-report,-book}'
gfngfn Nov 2, 2022
0b4c770
lessen contents of package config files
gfngfn Nov 2, 2022
04eefc8
Merge pull request #370 from gfngfn/dev-0-1-0-lock-file
gfngfn Nov 3, 2022
2f32a2c
support 'use open' etc.
gfngfn Nov 3, 2022
301833f
refactor libraries by using 'use package open'
gfngfn Nov 3, 2022
604bcbe
fix how to extend type environments with 'use package open'
gfngfn Nov 3, 2022
ae65ebc
remove 'Stdlib.'
gfngfn Nov 3, 2022
bda1b1a
use 'use package open' and 'use open' in '{tests,doc,demo}'
gfngfn Nov 3, 2022
8a43e85
Merge pull request #372 from gfngfn/dev-0-1-0-dev-use-open
gfngfn Nov 3, 2022
b12b274
begin to support package builds
gfngfn Nov 3, 2022
d451f37
support package builds
gfngfn Nov 3, 2022
da2866f
add 'package.satysfi-lock' to packages
gfngfn Nov 3, 2022
42ee609
set 'opam-depext' to false
gfngfn Nov 3, 2022
edc8e29
set 'opam-depext' to true again
gfngfn Nov 3, 2022
48fd6d6
re-support the 'Foo.(...)' syntax
gfngfn Nov 3, 2022
43612a8
fix 'subtype_type_scheme'
gfngfn Nov 3, 2022
ddcc384
extend 'UTConstructor' to take module names
gfngfn Nov 3, 2022
288a2db
update the parser test
gfngfn Nov 3, 2022
e911722
implement 'update_subsignature' for 'with type'
gfngfn Nov 3, 2022
3568508
extend 'UTPConstructor' to take module names
gfngfn Nov 3, 2022
f06325a
remove OCaml 4.12.1 from CI
gfngfn Nov 4, 2022
7943569
make lock configs support 'local'
gfngfn Nov 4, 2022
03874ea
begin to develop 'PackageConstraintSolver'
gfngfn Nov 6, 2022
3ebfbe1
develop 'PackageConstraintSolver' about semver
gfngfn Nov 6, 2022
8c3d612
develop 'PackageConstraintSolver.solve'
gfngfn Nov 6, 2022
79919ae
begin to develop 'PackageRegistry'
gfngfn Nov 6, 2022
f7553b1
make package contexts passed to the constraint solver through roles
gfngfn Nov 6, 2022
2ce9a8e
introduce 'LocalRole' and 'LocalImpl'
gfngfn Nov 6, 2022
ea7446b
add the interface file of 'PackageConstraintSolver'
gfngfn Nov 7, 2022
540282f
begin to add a subcommand 'solve' for constraint solving
gfngfn Nov 7, 2022
4d53ed1
begin to develop 'Main.solve'
gfngfn Nov 7, 2022
2f2fa48
develop command 'solve'
gfngfn Nov 7, 2022
4ca690b
refactor how to decode lock configs
gfngfn Nov 7, 2022
7dbee97
develop how to convert solutions to lock configs
gfngfn Nov 7, 2022
853f5ef
fix 'requires' of constraint solving
gfngfn Nov 7, 2022
e7d54e5
add 'dependencies:' to the configs of the pre-installed packages
gfngfn Nov 7, 2022
0d7506f
introduce the attribute syntax '#[foo ...]'
gfngfn Nov 7, 2022
d321e71
update the parser test
gfngfn Nov 7, 2022
dd2bfcd
introduce 'DocumentAttribute'
gfngfn Nov 7, 2022
7828f72
use 'DocumentAttribute' for specifying dependencies of documents
gfngfn Nov 7, 2022
02d153f
add '#[dependencies ...]' attribute to '{demo,doc}/*.saty'
gfngfn Nov 7, 2022
8ba9bf9
add 'Logging.show_package_dependency_{before_solving,solutions}'
gfngfn Nov 7, 2022
d1cf570
remove printf for debugging
gfngfn Nov 7, 2022
da59286
implement how to encode lock configs
gfngfn Nov 7, 2022
735e288
make 'LockConfig.write' output lock files
gfngfn Nov 7, 2022
0a5607b
generate '{demo,doc}/*.satysfi-lock' by 'satysfi solve'
gfngfn Nov 7, 2022
6038102
generate 'tests/**/*.satysfi-lock' by 'satysfi solve' (except for 'te…
gfngfn Nov 7, 2022
58c1117
develop how to load registry configs
gfngfn Nov 8, 2022
ac610ba
introduce 'dist/cache/registry.yaml'
gfngfn Nov 8, 2022
7697370
Merge pull request #373 from gfngfn/dev-0-1-0-constraint-solver
gfngfn Nov 9, 2022
13e9849
refactor how to read files
gfngfn Nov 11, 2022
89d242c
refactor Uchar-handling functions
gfngfn Nov 11, 2022
48f5dda
replace 'MyUtil.list_make' with 'List.init'
gfngfn Nov 11, 2022
b11a866
remove 'MyUtil.list_some', which was unused
gfngfn Nov 11, 2022
65833b1
replace 'MyUtil.list_fold_left_index' with 'Core.List.foldi'
gfngfn Nov 11, 2022
480924c
migrate 'pickup'
gfngfn Nov 11, 2022
29455a5
replace 'MyUtil.first_some' with 'List.find_map'
gfngfn Nov 11, 2022
61cb903
remove 'MyUtil.(+=)'
gfngfn Nov 11, 2022
ee130ff
separate '{Option,Result,Escape}Monad' from 'MyUtil'
gfngfn Nov 11, 2022
617d51c
remove sources that are no longer used
gfngfn Nov 11, 2022
6efda64
remove from 'MyUtil' functions that are no longer used
gfngfn Nov 11, 2022
72caea1
remove 'open_out_abs' by using 'Core.Out_channel.write_all'
gfngfn Nov 11, 2022
bdf84aa
fix tests about migration of modules
gfngfn Nov 11, 2022
3f9c01f
Merge pull request #374 from gfngfn/dev-0-1-0-refactor-file-path
gfngfn Nov 11, 2022
66a62f5
make 'Makefile' generate lock files and compare them to the correspon…
gfngfn Nov 11, 2022
d8866f5
make 'doc/Makefile' generate lock files and compare them to the corre…
gfngfn Nov 11, 2022
5df59ac
make 'tests/**/Makefile' generate lock files and compare them to the …
gfngfn Nov 11, 2022
2299b43
begin to develop the notion of font packages
gfngfn Nov 12, 2022
50ad7f8
add 'Load{Single,Collection}Font', 'FontType', etc.
gfngfn Nov 12, 2022
6391f31
replace 'font_abbrev' with 'FontKey.t'
gfngfn Nov 12, 2022
a1b2fc8
FIRST SUCCESS in typesetting 'demo.pdf' by using font packages
gfngfn Nov 12, 2022
61edbf9
slight refactoring
gfngfn Nov 12, 2022
0849d2d
replace 'math_font_abbrev' with 'FontKey.t'
gfngfn Nov 12, 2022
b7d26ff
discard 'LoadFont' and 'SetDefaultFont'
gfngfn Nov 12, 2022
4e9b385
discard 'lib-satysfi/{fonts,hash}'
gfngfn Nov 12, 2022
6c60b49
update 'demo.satysfi-lock-expected'
gfngfn Nov 12, 2022
e3fd715
update CI
gfngfn Nov 12, 2022
8868271
make 'doc/*.saty' pass
gfngfn Nov 12, 2022
5c413bd
fix 'opam-version'
gfngfn Nov 12, 2022
a5781b2
make 'doc/*.saty' pass (2)
gfngfn Nov 12, 2022
c1989e3
remove OCaml 4.13.1 from 'ci.yml'
gfngfn Nov 12, 2022
0950d7b
make 'tests/*' pass
gfngfn Nov 12, 2022
c43ac40
update lock files of packages
gfngfn Nov 12, 2022
43a5085
disable printf for debugging
gfngfn Nov 12, 2022
47cbcdc
refactor 'FontInfo' and 'FontFormat'
gfngfn Nov 12, 2022
c1927c0
modify 'FailedToDecodeFont'
gfngfn Nov 12, 2022
f5b1552
refactor 'FontFormat' to remove exception 'BrokenFont'
gfngfn Nov 12, 2022
ac0a37e
refactor 'FontFormat' (mostly cosmetic changes)
gfngfn Nov 12, 2022
5646c3e
completely remove exceptions from 'FontFormat'
gfngfn Nov 12, 2022
2f6479b
cosmetic changes
gfngfn Nov 12, 2022
a8b54e4
add 'logging.mli' etc.
gfngfn Nov 12, 2022
9d4568d
use '{,Math}FontIsNotSet'
gfngfn Nov 12, 2022
7db60f2
Merge pull request #375 from gfngfn/dev-0-1-0-font-package
gfngfn Nov 12, 2022
e450f24
add 'conversion' section to the format of 'satysfi.yaml'
gfngfn Nov 14, 2022
865d7e4
migrate 'omd' from '1.3.1' to '2.0.0~alpha2'
gfngfn Nov 14, 2022
153e836
modify how to decode Markdown documents
gfngfn Nov 14, 2022
2babe4c
implement how to extract Markdown command records from configs
gfngfn Nov 14, 2022
07a82c8
FIRST SUCCESS in using Markdown conversion rules given in package con…
gfngfn Nov 14, 2022
f71206f
slight refactoring of 'OpenFileDependencyResolver'
gfngfn Nov 14, 2022
1848486
abandon 'LoadMDSetting'
gfngfn Nov 14, 2022
86be82f
delete 'mdja.satysfi-md'
gfngfn Nov 14, 2022
47ab101
change the '--markdown' option to a flag
gfngfn Nov 14, 2022
e6cd964
change some field names about Markdown
gfngfn Nov 14, 2022
97579ba
remove flag '--markdown'
gfngfn Nov 14, 2022
1013781
remove flag '--show-fonts'
gfngfn Nov 14, 2022
17bf1c4
make 'satysfi solve' support Markdown inputs
gfngfn Nov 14, 2022
2fb962d
various small updates
gfngfn Nov 14, 2022
b14fb35
refactor 'DecodeMD' into monadic
gfngfn Nov 14, 2022
f92926c
rename 'DecodeMD' to 'MarkdownParser'
gfngfn Nov 14, 2022
3118894
refactor 'MarkdownParser' about variable names
gfngfn Nov 14, 2022
e93188e
abandon 'code_block_map'
gfngfn Nov 14, 2022
7208759
remove unnecessary code from 'md-ja.satyh'
gfngfn Nov 15, 2022
b836516
Merge pull request #376 from gfngfn/dev-0-1-0-markdown-package
gfngfn Nov 15, 2022
024478c
support 'test_dependencies' section
gfngfn Nov 15, 2022
e41b0f6
add 'reachability_closure' to 'DependencyGraph'
gfngfn Nov 15, 2022
bf1d1cc
develop tests for 'reachability_closure'
gfngfn Nov 15, 2022
6f1104c
use 'LockDependencyGraph' to compute source dependencies and test-onl…
gfngfn Nov 15, 2022
237a5cb
FIRST SUCCESS in distinguishing whether each dependency is for test only
gfngfn Nov 15, 2022
c88ee48
update tests
gfngfn Nov 15, 2022
c61b4d5
take 'test_only' in lock files into account when building
gfngfn Nov 15, 2022
c0fae46
update tests
gfngfn Nov 15, 2022
3f8ccf6
remove printf for debugging
gfngfn Nov 15, 2022
1d80ed0
Merge pull request #377 from gfngfn/dev-0-1-0-test-dependency
gfngfn Nov 15, 2022
6cd9ed6
make 'val' bindings support attributes
gfngfn Nov 15, 2022
aa6840d
make 'val' bindings support '#[test]' attributes
gfngfn Nov 15, 2022
153fcbd
add the subcommand 'satysfi test'
gfngfn Nov 16, 2022
a8ba9d7
make package configs support the 'test_directories' section
gfngfn Nov 16, 2022
8d49cf0
slight fixes on 'OptionState'
gfngfn Nov 16, 2022
3be1f55
add a small example unit test for 'stdlib'
gfngfn Nov 16, 2022
ddec1ce
make test result message printed, and set the exit status code to 1 w…
gfngfn Nov 17, 2022
a688852
change the result type of tests from 'option string' to 'unit'
gfngfn Nov 17, 2022
848b94b
fix how to run tests about 'use_test_only_lock'
gfngfn Nov 17, 2022
6828cfb
develop a new package 'testing' and use it in tests for 'stdlib'
gfngfn Nov 17, 2022
71f20d1
Merge pull request #378 from gfngfn/dev-0-1-0-test-system
gfngfn Nov 17, 2022
13bc074
slight refactoring
gfngfn Nov 18, 2022
4ea8383
extend the format of registry configs with sections about how to fetc…
gfngfn Nov 18, 2022
6335309
extend 'package_solution' with 'locked_source'
gfngfn Nov 18, 2022
f0bea39
introduce 'implementation_spec'
gfngfn Nov 19, 2022
14d79ca
introduce 'primary_root_dir' for fetching package implementations
gfngfn Nov 19, 2022
9613c8d
update expected lock files
gfngfn Nov 19, 2022
55a9ba6
update CI about 'diff' on 'macos-latest'
gfngfn Nov 21, 2022
bcdbf10
add 'LockFetcher'
gfngfn Nov 22, 2022
7644fb6
develop how to extract tarballs of locked packages
gfngfn Nov 22, 2022
30c4c8c
small fixes
gfngfn Nov 22, 2022
2bea99c
add an interface file to 'LockFetcher'
gfngfn Dec 5, 2022
5291900
small changes
gfngfn Dec 5, 2022
27ac5d8
Merge pull request #379 from gfngfn/dev-0-1-0-package-fetch
gfngfn Dec 5, 2022
e05a63c
remove 'dist/'
gfngfn Dec 6, 2022
35dca89
update expected lock files
gfngfn Dec 6, 2022
97474e2
update 'download-fonts.sh'
gfngfn Dec 6, 2022
ffc588a
Merge pull request #380 from gfngfn/dev-0-1-0-discard-dist-and-local
gfngfn Dec 6, 2022
aeb99f3
modify how to decode version requirements
gfngfn Dec 7, 2022
7fa26a3
modify version requirements in config files
gfngfn Dec 7, 2022
4ee734f
modify version requirements in 'test.md'
gfngfn Dec 7, 2022
eb1e2fd
Merge pull request #381 from gfngfn/dev-0-1-0-modify-version-requirem…
gfngfn Dec 7, 2022
0a82268
make multiple versions of a package incompatible to each other able t…
gfngfn Dec 8, 2022
5dd55a8
fix 'PackageConstraintSolver' about name collision
gfngfn Dec 8, 2022
26c5338
refactor about locks
gfngfn Dec 8, 2022
db12c59
fix the constraint solver and add a test for it
gfngfn Dec 8, 2022
fe3d9c3
add a test for the constraint solver
gfngfn Dec 8, 2022
17b8dd6
Merge pull request #382 from gfngfn/dev-0-1-0-incompatible-version-co…
gfngfn Dec 9, 2022
4957f4d
add 'package_name_decoder' etc.
gfngfn Dec 9, 2022
7715f06
rename 'PackageRegistry' to 'PackageRegistryConfig'
gfngfn Dec 9, 2022
56c432a
add 'name' and 'authors' sections to the package config format
gfngfn Dec 9, 2022
3facf7b
add 'name' and 'authors' sections to package configs
gfngfn Dec 9, 2022
541ace3
fix unit tests
gfngfn Dec 9, 2022
587e5c0
add 'check-packages.sh' (for CI as well as for manual execution)
gfngfn Dec 10, 2022
6002693
update how to decode/encode the package/lock configs
gfngfn Dec 10, 2022
8779d45
update config files and lock files
gfngfn Dec 10, 2022
759e893
update lock files
gfngfn Dec 10, 2022
8acc695
add the 'language' section to the 'implementations' entry format in r…
gfngfn Dec 10, 2022
d03d05a
fix tests
gfngfn Dec 10, 2022
8dfb04f
refactor how to run tests in CI
gfngfn Dec 10, 2022
8086423
update tests of checking packages
gfngfn Dec 10, 2022
8ec4f36
Merge pull request #383 from gfngfn/dev-0-1-0-refactor-configs
gfngfn Dec 10, 2022
05c9702
add 'LibraryRootConfig'
gfngfn Dec 10, 2022
f2ebbc4
slight changes
gfngfn Dec 10, 2022
d849871
add the 'registry' section etc. to config formats
gfngfn Dec 11, 2022
ec1b55e
update config files
gfngfn Dec 11, 2022
8728d7b
fix unit tests
gfngfn Dec 11, 2022
54d7247
fix 'MarkdownParser' about '#[config ...]'
gfngfn Dec 11, 2022
967b1cc
update 'test.md' about '#[config ...]'
gfngfn Dec 11, 2022
4fedfda
add 'LibraryRootConfig.write'
gfngfn Dec 11, 2022
79fa0f3
implement 'PackageRegistryFetcher'
gfngfn Dec 11, 2022
98a00a9
migrate 'satysfi-registry.yaml' to 'https://github.com/SATySFi/defaul…
gfngfn Dec 11, 2022
cd5bf43
refactor by using 'Constant'
gfngfn Dec 11, 2022
7156557
refactor by introducing 'ShellCommand'
gfngfn Dec 11, 2022
3957c09
refine how to decode document attributes
gfngfn Dec 11, 2022
e45029e
refine how to decode document attributes (2)
gfngfn Dec 11, 2022
c074573
implement 'CanonicalRegistryUrl'
gfngfn Dec 11, 2022
4a3c3a2
Merge pull request #384 from gfngfn/dev-0-1-0-registry-fetch
gfngfn Dec 11, 2022
2c46b3c
add the 'external_sources' to the package config format
gfngfn Dec 12, 2022
e6e4b78
develop 'LockFetcher' about 'external_sources'
gfngfn Dec 12, 2022
746ebad
develop 'LockFetcher' about checking fetched files by checksums
gfngfn Dec 12, 2022
ad1536e
develop 'LockFetcher' about extracting zip files
gfngfn Dec 12, 2022
b0b2971
implement how to copy files extracted from zip files
gfngfn Dec 12, 2022
940f785
add an 'external_sources' section to config files of font packages
gfngfn Dec 12, 2022
804c9c4
add 'make-package-tarballs.sh' for testing releases
gfngfn Dec 12, 2022
54c7cae
fix 'make-package-tarballs.sh'
gfngfn Dec 12, 2022
2934986
fix how to match checksums
gfngfn Dec 12, 2022
dc1bc4e
use remote packages in CI
gfngfn Dec 12, 2022
dd544e2
use remote packages in CI (2)
gfngfn Dec 12, 2022
6622f8b
use remote packages in CI (3)
gfngfn Dec 12, 2022
c0cafcd
use remote packages in CI (4)
gfngfn Dec 12, 2022
e715ee8
Merge pull request #385 from gfngfn/dev-0-1-0-external-source
gfngfn Dec 12, 2022
b10607c
support 'format' and 'checksum' of registry configs
gfngfn Dec 12, 2022
35236e9
add registry hash values to paths to locked packages
gfngfn Dec 12, 2022
a862853
add registry hash values to paths to cache files
gfngfn Dec 12, 2022
5ad9736
add registry hash values to paths to cache files (2)
gfngfn Dec 12, 2022
4ea6f8d
update lock file expectations
gfngfn Dec 12, 2022
910712f
update unit tests
gfngfn Dec 12, 2022
dc391b7
update lock files of packages
gfngfn Dec 12, 2022
3aa4023
Merge pull request #386 from gfngfn/dev-0-1-0-small-fixes-of-package-…
gfngfn Dec 12, 2022
148f39b
begin to refactor 'Constant'
gfngfn Dec 17, 2022
785abf9
begin to refactor 'Constant' (2)
gfngfn Dec 18, 2022
92e1b3d
refactor paths about locks
gfngfn Dec 18, 2022
063dcc4
fix the version of 'omd' to '2.0.0~alpha'
gfngfn Dec 18, 2022
7437cb1
fix the version of 'omd' to '2.0.0~alpha3'
gfngfn Dec 18, 2022
16146db
update lock files
gfngfn Dec 18, 2022
bb064b1
change the lock config format and refactor how to determine the libra…
gfngfn Dec 18, 2022
e66294e
change the lock config format and refactor how to determine the libra…
gfngfn Dec 18, 2022
6ef1ada
change the lock config format and refactor how to determine the libra…
gfngfn Dec 18, 2022
d1e7778
update lock files
gfngfn Dec 18, 2022
499420d
update lock files (2)
gfngfn Dec 18, 2022
b5f6fee
update the package config format
gfngfn Dec 18, 2022
1580297
update packages
gfngfn Dec 18, 2022
fb23502
update unit tests
gfngfn Dec 18, 2022
adeba36
Merge pull request #387 from gfngfn/dev-0-1-0-refactor-config-path
gfngfn Dec 18, 2022
1bf3543
merge 'dev-0-1-0' with conflicts fixed
gfngfn May 25, 2023
04da70c
merge `master` via `dev-0-1-0` with conflicts fixed
gfngfn Oct 24, 2023
bcee545
upgrade the URL for the Latin Modern font in `font-latin-modern`
gfngfn Oct 24, 2023
4990513
remove `output_mode` from `OptionState`
gfngfn Oct 29, 2023
aae3ab0
remove `bytecomp` from `OptionState`
gfngfn Oct 29, 2023
1e236dc
remove `page_number_limit` from `OptionState`
gfngfn Oct 29, 2023
3a2cadc
migrate `debug_*` fields from `OptionState` to `HandlePdf.config`
gfngfn Oct 29, 2023
5176297
remove unnecessary fields from `OptionState`
gfngfn Oct 29, 2023
b586422
refactor `OptionState` about `input_file`
gfngfn Oct 29, 2023
fed99e2
migrate `show_full_path` from `OptionState` to `Logging`
gfngfn Oct 30, 2023
4c8a575
migrate `job_directory` to `runtime_config`, and delete `OptionState`
gfngfn Oct 30, 2023
da99d03
Merge pull request #420 from gfngfn/discard-option-state
gfngfn Nov 29, 2023
b8b4ae4
Allow importing submodules in use statement
kyori19 Dec 1, 2023
66af49c
remove unnecessary open
kyori19 Dec 4, 2023
12d4c64
Merge pull request #421 from kyori19/use-submodules
gfngfn Dec 5, 2023
6bcd2f5
merge `dev-0-1-0` with conflicts fixed
gfngfn Apr 7, 2024
dd0c14f
merge `dev-0-1-0` with conflicts in the CI workflow fixed
gfngfn Jun 22, 2024
bbaea00
merge `dev-0-1-0` with a lot of conflicts fixed (probably midway)
gfngfn Aug 11, 2024
7ed6178
fix dependencies
gfngfn Aug 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add 'Load{Single,Collection}Font', 'FontType', etc.
  • Loading branch information
gfngfn committed Nov 12, 2022
commit 50ad7f80d07aebc9dc7b92fd6005a2561c4e96b8
12 changes: 12 additions & 0 deletions src/frontend/bytecomp/ir.cppo.ml
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,12 @@ and transform_1 (env : frame) (ast : abstract_tree) : ir * frame =
| ASTCodeSymbol(_symb) ->
report_bug_ir "transform_1: ASTCodeSymbol at stage 1"

| LoadSingleFont(_) ->
failwith "TODO: LoadSingleFont"

| LoadCollectionFont(_, _) ->
failwith "TODO: LoadCollectionFont"

#include "__ir_1.gen.ml"


Expand Down Expand Up @@ -756,4 +762,10 @@ and transform_0 (env : frame) (ast : abstract_tree) : ir * frame =
| ASTCodeSymbol(symb) ->
return (IRConstant(CodeSymbol(symb)))

| LoadSingleFont(_) ->
failwith "TODO: LoadSingleFont"

| LoadCollectionFont(_, _) ->
failwith "TODO: LoadCollectionFont"

#include "__ir_0.gen.ml"
1 change: 1 addition & 0 deletions src/frontend/display.ml
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ let show_base_type = function
| PathType -> "path"
| GraphicsType -> "graphics"
| ImageType -> "image"
| FontType -> "font"
| DocumentType -> "document"
| RegExpType -> "regexp"
| TextInfoType -> "text-info"
Expand Down
12 changes: 12 additions & 0 deletions src/frontend/evaluator.cppo.ml
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,12 @@ and interpret_0 (env : environment) (ast : abstract_tree) : syntactic_value =
| ASTCodeSymbol(_symb) ->
report_bug_ast "ASTCodeSymbol(_) at stage 0" ast

| LoadSingleFont(_abspath_font) ->
failwith "TODO: LoadSingleFont"

| LoadCollectionFont(_abspath_font, _index) ->
failwith "TODO: LoadCollectionFont"

#include "__evaluator_0.gen.ml"


Expand Down Expand Up @@ -586,6 +592,12 @@ and interpret_1 (env : environment) (ast : abstract_tree) : code_value =
| ASTCodeSymbol(symb) ->
CdContentOf(Range.dummy "ASTCodeSymbol", symb)

| LoadSingleFont(_abspath_font) ->
failwith "TODO: LoadSingleFont"

| LoadCollectionFont(_abspath_font, _index) ->
failwith "TODO: LoadCollectionFont"

#include "__evaluator_1.gen.ml"


Expand Down
40 changes: 38 additions & 2 deletions src/frontend/packageChecker.ml
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,44 @@ let check_library_package (tyenv_prim : Typeenv.t) (genv : global_type_environme
| None -> err @@ NoMainModule(main_module_name)


let check_font_package (_main_module_name : module_name) (_font_files : (abs_path * font_file_contents) list) =
failwith "TODO: check_font_package"
let check_font_package (_main_module_name : module_name) (font_files : (abs_path * font_file_contents) list) =
let open ResultMonad in
let stage = Persistent0 in
let (ssig, libacc) =
font_files |> List.fold_left (fun (ssig, libacc) (abspath_font, font_file_contents) ->
match font_file_contents with
| OpentypeSingle(varnm) ->
let evid = EvalVarID.fresh (Range.dummy "font-package 1", varnm) in
let bind = Bind(stage, NonRec(evid, LoadSingleFont(abspath_font))) in
let ventry =
{
val_name = Some(evid);
val_type = Poly(Range.dummy "font-package 2", BaseType(FontType));
val_stage = stage;
}
in
(ssig |> StructSig.add_value varnm ventry, Alist.extend libacc (abspath_font, [ bind ]))

| OpentypeCollection(varnms) ->
let (ssig, bindacc, _) =
varnms |> List.fold_left (fun (ssig, bindacc, index) varnm ->
let evid = EvalVarID.fresh (Range.dummy "font-package 3", varnm) in
let bind = Bind(stage, NonRec(evid, LoadCollectionFont(abspath_font, index))) in
let ventry =
{
val_name = Some(evid);
val_type = Poly(Range.dummy "font-package 4", BaseType(FontType));
val_stage = stage;
}
in
(ssig |> StructSig.add_value varnm ventry, Alist.extend bindacc bind, index + 1)
) (ssig, Alist.empty, 0)
in
(ssig, Alist.extend libacc (abspath_font, Alist.to_list bindacc))

) (StructSig.empty, Alist.empty)
in
return (ssig, Alist.to_list libacc)


let main (tyenv_prim : Typeenv.t) (genv : global_type_environment) (package : untyped_package) : (StructSig.t * (abs_path * binding list) list) ok =
Expand Down
5 changes: 5 additions & 0 deletions src/frontend/types.cppo.ml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ type base_type =
| PathType
| GraphicsType
| ImageType
| FontType
| DocumentType
| RegExpType
| TextInfoType
Expand Down Expand Up @@ -182,6 +183,7 @@ let base_type_map : base_type TypeNameMap.t =
("path" , PathType);
("graphics" , GraphicsType);
("image" , ImageType);
("font" , FontType);
("document" , DocumentType);
("regexp" , RegExpType);
("text-info" , TextInfoType);
Expand Down Expand Up @@ -1031,6 +1033,9 @@ and abstract_tree =
| Persistent of Range.t * EvalVarID.t
| Lift of abstract_tree
| ASTCodeSymbol of CodeSymbol.t
(* Fonts: *)
| LoadSingleFont of abs_path
| LoadCollectionFont of abs_path * int
(* Primitive applications: *)
#include "__attype.gen.ml"

Expand Down