diff options
author | The Lux Programming Language | 2017-12-02 14:33:40 -0400 |
---|---|---|
committer | GitHub | 2017-12-02 14:33:40 -0400 |
commit | a3687e36a71ebbc3069260e904e47272933a48a1 (patch) | |
tree | 0783fac3f94ea4765dfc91b0fe85b9b1a37cb5d8 /new-luxc/source/luxc/lang/analysis/case | |
parent | 0ea9403e482b7f01df9e634ae2533b20ef56a9ab (diff) | |
parent | c72e120e8c2c300411c0cb07ecb3b6bc32e0cb24 (diff) |
Merge pull request #42 from LuxLang/context_sensitive_macro_expansion
Context sensitive macro expansion
Diffstat (limited to '')
-rw-r--r-- | new-luxc/source/luxc/lang/analysis/case.lux | 8 | ||||
-rw-r--r-- | new-luxc/source/luxc/lang/analysis/case/coverage.lux | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/new-luxc/source/luxc/lang/analysis/case.lux b/new-luxc/source/luxc/lang/analysis/case.lux index 16f775907..c40bb2ac3 100644 --- a/new-luxc/source/luxc/lang/analysis/case.lux +++ b/new-luxc/source/luxc/lang/analysis/case.lux @@ -214,7 +214,7 @@ [nextA next] (wrap [(list) nextA])) (list.reverse matches))] - (wrap [(` ("lux case tuple" [(~@ memberP+)])) + (wrap [(` ("lux case tuple" [(~+ memberP+)])) thenA]))) _ @@ -250,12 +250,12 @@ (do macro.Monad<Meta> [[testP nextA] (analyse-pattern #.None (type.variant (list.drop (n/dec num-cases) flat-sum)) - (` [(~@ values)]) + (` [(~+ values)]) next)] (wrap [(` ("lux case variant" (~ (code.nat idx)) (~ (code.nat num-cases)) (~ testP))) nextA])) (do macro.Monad<Meta> - [[testP nextA] (analyse-pattern #.None case-type (` [(~@ values)]) next)] + [[testP nextA] (analyse-pattern #.None case-type (` [(~+ values)]) next)] (wrap [(` ("lux case variant" (~ (code.nat idx)) (~ (code.nat num-cases)) (~ testP))) nextA]))) @@ -274,7 +274,7 @@ [idx group variantT] (macro.resolve-tag tag) _ (&.with-type-env (tc.check inputT variantT))] - (analyse-pattern (#.Some (list.size group)) inputT (` ((~ (code.nat idx)) (~@ values))) next))) + (analyse-pattern (#.Some (list.size group)) inputT (` ((~ (code.nat idx)) (~+ values))) next))) _ (&.throw Unrecognized-Pattern-Syntax (%code pattern)) diff --git a/new-luxc/source/luxc/lang/analysis/case/coverage.lux b/new-luxc/source/luxc/lang/analysis/case/coverage.lux index 5d34387b4..ae72b47e4 100644 --- a/new-luxc/source/luxc/lang/analysis/case/coverage.lux +++ b/new-luxc/source/luxc/lang/analysis/case/coverage.lux @@ -71,7 +71,7 @@ ## Tuple patterns can be exhaustive if there is exhaustiveness for all of ## their sub-patterns. - (^code ("lux case tuple" [(~@ subs)])) + (^code ("lux case tuple" [(~+ subs)])) (loop [subs subs] (case subs #.Nil |