Skip to content

Commit

Permalink
Merge pull request #243 from timholy/teh/lowered
Browse files Browse the repository at this point in the history
Rewrite based on lowered code
  • Loading branch information
timholy authored Mar 20, 2019
2 parents a2c0fd6 + 8065081 commit 7807873
Show file tree
Hide file tree
Showing 19 changed files with 1,186 additions and 1,312 deletions.
19 changes: 5 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,13 @@ git:
# allow_failures:
# - julia: nightly

## uncomment and modify the following lines to manually install system packages
#addons:
# apt: # apt-get for linux
# packages:
# - gfortran
#before_script: # homebrew for mac
# - if [ $TRAVIS_OS_NAME = osx ]; then brew install gcc; fi

## uncomment the following lines to override the default test script
script:
- julia -e 'using Pkg; Pkg.clone(pwd()); Pkg.build("Revise"); Pkg.test("Revise"; coverage=true)'
- JULIA_REVISE_POLL=1 julia --code-coverage -e 'using Pkg, Revise; include(joinpath(dirname(pathof(Revise)), "..", "test", "polling.jl"))'
- export JULIA_PROJECT=""
- julia --project -e 'using Pkg; Pkg.build(); Pkg.test();'
- JULIA_REVISE_POLL=1 julia --project -e 'using Pkg, Revise; include(joinpath(dirname(pathof(Revise)), "..", "test", "polling.jl"))'

after_script: # TODO: change to after_success once https://github.com/JuliaLang/julia/issues/28306 is fixed
# push coverage results to Codecov
- julia -e 'using Pkg, Revise; cd(joinpath(dirname(pathof(Revise)), "..")); Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())'
after_success:
- julia -e 'import Pkg; Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())'

jobs:
include:
Expand Down
29 changes: 29 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name = "Revise"
uuid = "295af30f-e4ad-537b-8983-00126c2a3abe"
version = "2.0.0"

[deps]
CodeTracking = "da1fd8a2-8d9e-5ec2-8556-3022fb5608a2"
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
FileWatching = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee"
JuliaInterpreter = "aa1ae85d-cabe-5617-a682-6adf51b2e16a"
LibGit2 = "76f85450-5226-5b5a-8eaa-529ad045b433"
LoweredCodeUtils = "6f1432cf-f94c-5a45-995e-cdbf5db27b0b"
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
Unicode = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"

[compat]
CodeTracking = "0.4"
JuliaInterpreter = "0.2, 0.3"
LoweredCodeUtils = "0.2"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Example = "7876af07-990d-54b4-ab0e-23690620f79a"
EponymTuples = "97e2ac4a-e175-5f49-beb1-4d6866a6cdc3"

[targets]
test = ["Test", "Example", "EponymTuples"]
4 changes: 3 additions & 1 deletion REQUIRE
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
julia 1.0
OrderedCollections
CodeTracking
CodeTracking 0.4 0.5
JuliaInterpreter 0.2 0.4
LoweredCodeUtils 0.2 0.3
2 changes: 1 addition & 1 deletion docs/src/dev_reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Revise.RelocatableExpr
Revise.DefMap
Revise.SigtMap
Revise.FMMaps
Revise.FileModules
Revise.ModuleExprsSigs
Revise.FileInfo
Revise.PkgData
Revise.WatchList
Expand Down
20 changes: 10 additions & 10 deletions docs/src/internals.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,21 +230,21 @@ where here `def` is the expression defining `print_item`.

When the file system notifies Revise that a file has been modified, Revise re-parses
the file and assigns the expressions to the appropriate modules, creating a
[`Revise.FileModules`](@ref) `fmnew`.
It then compares `fmnew` against `fmref`, the reference object that is synchronized to
[`Revise.ModuleExprsSigs`](@ref) `mexsnew`.
It then compares `mexsnew` against `mexsref`, the reference object that is synchronized to
code as it was `eval`ed.
The following actions are taken:

- if a `def` entry in `fmref` is equal to one `fmnew`, the expression is "unchanged"
except possibly for line number. The `lineoffset` in `fmref` is updated as needed.
- if a `def` entry in `fmref` is not present in `fmnew`, that entry is deleted and
- if a `def` entry in `mexsref` is equal to one `mexsnew`, the expression is "unchanged"
except possibly for line number. The `lineoffset` in `mexsref` is updated as needed.
- if a `def` entry in `mexsref` is not present in `mexsnew`, that entry is deleted and
any corresponding methods are also deleted.
- if a `def` entry in `fmnew` is not present in `fmref`, it is `eval`ed and then added to
`fmref`.
- if a `def` entry in `mexsnew` is not present in `mexsref`, it is `eval`ed and then added to
`mexsref`.

Technically, a new `fmref` is generated every time to ensure that the expressions are
ordered as in `fmnew`; however, conceptually this is better thought of as an updating of
`fmref`, after which `fmnew` is discarded.
Technically, a new `mexsref` is generated every time to ensure that the expressions are
ordered as in `mexsnew`; however, conceptually this is better thought of as an updating of
`mexsref`, after which `mexsnew` is discarded.

### Internal API

Expand Down
Loading

0 comments on commit 7807873

Please sign in to comment.