Commit graph

1072 commits

Author SHA1 Message Date
Leonardo de Moura
1016309d1f feat(library/init/lean/path): always add builtin search path
We also add "." (i.e., current directory) if `LEAN_PATH` is not defined.
Users may still override stdlib since we add the builtin search path in the end.

@dselsam You should now be able to compile your project without setting `LEAN_PATH`

cc @kha
2019-07-31 18:13:17 -07:00
Leonardo de Moura
bfb5bd3752 feat(library/init/lean/elaborator): add universe and universes elaborators 2019-07-31 16:46:02 -07:00
Leonardo de Moura
46f361daab feat(library/init/lean/elaborator): add open command elaborator 2019-07-31 15:58:04 -07:00
Leonardo de Moura
a9ba3773c7 fix(library/init/lean/path): add support for default.lean 2019-07-31 15:58:04 -07:00
Leonardo de Moura
2f5b2b2409 feat(library/init/lean/path): add realPathNormalized 2019-07-28 20:52:41 -07:00
Leonardo de Moura
378d75b3b4 feat(library/init/lean/path): use toLower at normalizePath if file system is case-insensitive 2019-07-28 19:50:01 -07:00
Leonardo de Moura
a48d635004 chore(library/init/lean/path): include search path in error message
Trying to understand why the Windows build is failing at Azure.
2019-07-28 19:11:01 -07:00
Leonardo de Moura
1d0d65893b fix(library/init/lean/path): user normalizePathSeparators at moduleNameOfFileName 2019-07-28 10:09:51 -07:00
Leonardo de Moura
e0d1892d72 fix(library/init): add normalizePathSeparators
Trying to fix broken tests on Windows.
2019-07-28 08:21:48 -07:00
Leonardo de Moura
66a93dbb39 feat(library/init/lean/elaborator/basic): absolutizeModuleName 2019-07-27 18:17:21 -07:00
Leonardo de Moura
2c755c60f5 feat(library/init/lean/path): fileNameToModuleName 2019-07-27 09:56:37 -07:00
Leonardo de Moura
bf5afbc289 feat(library/init/lean/environment): use findOLean implemented in Lean
TODO: cleanup `path.lean`
2019-07-26 17:57:43 -07:00
Leonardo de Moura
c1e217da2b feat(library/init/lean/path): absolutizeModuleName 2019-07-26 17:26:44 -07:00
Leonardo de Moura
9bed367cc0 feat(library/init/lean/modulename): add helper functions 2019-07-26 16:46:03 -07:00
Leonardo de Moura
e9fafd3c4b chore(library/init/lean/path,stage0): export initSearchPath and update 2019-07-26 16:06:19 -07:00
Leonardo de Moura
e722ea9ed9 feat(library/init/lean): implement findOLean and findLean in Lean 2019-07-26 16:04:10 -07:00
Leonardo de Moura
5a1380ec6a feat(library/init/lean): add lean/path.lean 2019-07-25 19:28:22 -07:00
Leonardo de Moura
ff88c35fc1 refactor(library/init): move io and platform to system subdir 2019-07-25 17:29:33 -07:00
Leonardo de Moura
f6d3fc881d feat(library/init): add platform.cpp 2019-07-25 17:19:50 -07:00
Leonardo de Moura
72ff4eb8e2 feat(library/init/lean/elaborator/command): implement export command 2019-07-24 14:55:27 -07:00
Leonardo de Moura
e0797bba14 fix(library/init/lean/elaborator/command): bug at addScopes 2019-07-24 14:55:05 -07:00
Leonardo de Moura
3145994e36 feat(library/init/lean/elaborator/basic): register declaration name prefixes as namespaces at Environment.add 2019-07-24 13:24:02 -07:00
Leonardo de Moura
cf8daf4b24 feat(library/init/lean/elaborator): process header
TODO:
- improve/fix `setSearchPath`
- add `IO.getEnv`
- add support for relative imports at `absolutizeModuleName`
2019-07-24 07:37:33 -07:00
Leonardo de Moura
b792afb9d5 feat(library/init/lean/elaborator): add root scope and resolveNamespace 2019-07-23 09:14:01 -07:00
Leonardo de Moura
4187a099c2 fix(library/init/lean/elaborator/command): typo 2019-07-22 19:08:16 -07:00
Leonardo de Moura
b5d4e0a2fd chore(library/init/lean/elaborator/basic): improve cryptic error message 2019-07-22 19:07:43 -07:00
Leonardo de Moura
39b5fbb767 feat(library/init/lean/elaborator): registerNamespace 2019-07-22 18:47:25 -07:00
Leonardo de Moura
825c952f58 chore(library/init/lean/scopes): add TODO 2019-07-22 18:22:56 -07:00
Leonardo de Moura
c40cba66fb fix(library/init/lean/parser/parser): use eraseDups when registering builting parsers 2019-07-22 18:19:47 -07:00
Leonardo de Moura
3609057848 feat(library/init/lean/elaborator/basic): add OpenDecl 2019-07-22 17:40:37 -07:00
Leonardo de Moura
b098cc69ea chore(library/init/lean/elaborator/command): ignore Lean3 notation commands 2019-07-22 15:16:17 -07:00
Leonardo de Moura
231c01bf9f feat(library/init/lean): add alias.lean 2019-07-22 15:06:17 -07:00
Leonardo de Moura
2387f3c2a2 feat(library/init/lean/elaborator): improve namespace, scope, and end commands 2019-07-22 08:14:35 -07:00
Leonardo de Moura
eb47746647 feat(library/init/lean/elaborator): namespace, section and end commands 2019-07-21 16:55:23 -07:00
Leonardo de Moura
fdb2fb3f0d chore(library/init/lean): add helper function 2019-07-21 08:21:20 -07:00
Leonardo de Moura
a535d348de feat(library/init/lean/elaborator): use SyntaxNode to define TermElab and CommandElab 2019-07-21 07:29:41 -07:00
Leonardo de Moura
35d841e6ea chore(library/init/lean/syntax): change default to Empty 2019-07-20 06:57:48 -07:00
Leonardo de Moura
fdbbdf68fc refactor(library/init/lean/elaborator/basic): make sure ElabState does not depend on parser state
cc @kha
2019-07-19 17:07:39 -07:00
Leonardo de Moura
76c27c9aa4 feat(library/init/lean/syntax): update preresolved field
The `Nat` is for handling the ambiguous `.` notation in Lean during
preresolution. Recall that `x.y` may represent a hierarchical name or
a "field access".
2019-07-19 11:11:50 -07:00
Leonardo de Moura
2ad33a23db chore(runtime,library/init/lean): remove evalConst 2019-07-19 11:04:57 -07:00
Leonardo de Moura
b634fc30ee chore(library/init/lean/elaborator/command): add command.lean 2019-07-19 10:54:39 -07:00
Leonardo de Moura
27e0ad0d9e chore(library/init/lean/compiler/ir/emitcpp): remove constant registration 2019-07-19 10:52:18 -07:00
Leonardo de Moura
f9459f6e93 feat(library/init/lean/syntax): add Syntax.other
We will use this feature to implement the new elaborator.
An elaborator produces `Syntax Expr` instead of `Syntax`.
2019-07-19 10:45:01 -07:00
Leonardo de Moura
bf64310603 chore(library/init/lean): minor 2019-07-19 07:21:24 -07:00
Leonardo de Moura
b3e0a1d04e feat(library/init/lean/elaborator/basic): improve error handling, add simple test 2019-07-18 17:52:01 -07:00
Leonardo de Moura
eb7b2b77fa chore(library/init/lean): minor changes 2019-07-18 17:16:44 -07:00
Leonardo de Moura
99c465b425 feat(library/init/lean/elaborator/basic): add basic error handling functions 2019-07-18 16:37:39 -07:00
Leonardo de Moura
d92cd91ab3 feat(library/init/lean/elaborator/basic): add processCommand and test function 2019-07-18 16:12:18 -07:00
Leonardo de Moura
4e94bdae48 feat(library/init/lean/elaborator/basic): add [elabTerm] and [elabCommand] attributes 2019-07-18 15:27:27 -07:00
Leonardo de Moura
b1d5a4284d feat(library/init/lean): address issue raised in the previous commit
We also changed the type of `addImportedFn` to `Array (Array α) → IO σ`.
This modification avoids the `unsafeIO` hack at `parser.lean`.
2019-07-18 13:20:46 -07:00