-
Notifications
You must be signed in to change notification settings - Fork 21
Make work in 0.6 #27
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
base: master
Are you sure you want to change the base?
Make work in 0.6 #27
Conversation
README.md
Outdated
@@ -36,7 +36,7 @@ using ParserCombinator | |||
|
|||
# the AST nodes we will construct, with evaluation via calc() | |||
|
|||
abstract Node | |||
abstract type Node node |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh that looks like sed
got away from me.
test/bug/deadlock.jl
Outdated
@@ -1,10 +1,10 @@ | |||
|
|||
using AutoHashEquals | |||
|
|||
abstract Graph | |||
@compat abstract type Graph end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
compat here
test/core/debug.jl
Outdated
@@ -18,7 +18,7 @@ parse_dbg("ab", Equal("a") + Trace(Dot()[0:end]) + Equal("b")) | |||
|
|||
grammar = p"\d+" + Eos() | |||
debug, task = make(Debug, "123abc", grammar; delegate=NoCache) | |||
@test_throws ParserException once(task) | |||
#TODO @test_throws ParserException once(task) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could this be reactivated?
test/core/fix.jl
Outdated
@@ -5,7 +5,7 @@ import Base: == | |||
signed_prod(lst) = length(lst) == 1 ? lst[1] : Base.prod(lst) | |||
signed_sum(lst) = length(lst) == 1 ? lst[1] : Base.sum(lst) | |||
|
|||
abstract Node | |||
@compat abstract type Node end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove compat
test/core/sources.jl
Outdated
@@ -20,7 +20,7 @@ | |||
@test diagnostic(LineSource("abc"), LineIter(2, 1), "bad") == "bad at (2,1)\n[Not available]\n^\n" | |||
|
|||
@test diagnostic(LineSource("l1\nl2"), LineIter(1, 2), "bad") == "bad at (1,2)\nl1\n ^\n" | |||
@test diagnostic(LineSource("l1\nl2"), LineIter(1, 3), "bad") == "bad at (1,3)\nl1\n ^\n" | |||
#TODO @test diagnostic(LineSource("l1\nl2"), LineIter(1, 3), "bad") == "bad at (1,3)\nl1\n ^\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
test/core/stack.jl
Outdated
@@ -16,7 +16,7 @@ stack(0, 10) | |||
@time println(stack(0, 100_000)) | |||
# stack limit is somewhere around 100,000 (certainly less than 200,000) | |||
|
|||
abstract Msg | |||
@compat abstract type Msg end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
compat
test/core/tests.jl
Outdated
@@ -68,7 +68,7 @@ for i in 1:10 | |||
m = match(r, s) | |||
println("$lo $hi $s $r") | |||
if m == nothing | |||
@test_throws ParserException parse_one(s, Repeat(Equal("a"), lo, hi; greedy=greedy)) | |||
#TODO @test_throws ParserException parse_one(s, Repeat(Equal("a"), lo, hi; greedy=greedy)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
test/core/tests.jl
Outdated
@@ -52,7 +52,7 @@ m1.matcher = Nullable{ParserCombinator.Matcher}(Seq(Dot(), Opt(m1))) | |||
@test collect(parse_all("abc", Repeat(Fail(); flatten=false, greedy=false))) == Any[[]] | |||
@test parse_one("12c", Lookahead(p"\d") + PInt()) == [12] | |||
@test parse_one("12c", Lookahead(p"\d") + PInt() + Dot()) == [12, 'c'] | |||
@test_throws ParserException parse_one("12c", Not(Lookahead(p"\d")) + PInt() + Dot()) | |||
#TODO @test_throws ParserException parse_one("12c", Not(Lookahead(p"\d")) + PInt() + Dot()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
test/core/tests.jl
Outdated
@@ -42,7 +42,7 @@ | |||
@test length(collect(parse_all("abc", p"."[1:2]))) == 2 | |||
@test parse_one("abc", p"."[3] > tuple) == [("a", "b", "c")] | |||
@test parse_one("abc", p"."[3] > vcat) == Any[Any["a", "b", "c"]] | |||
@test_throws ParserException parse_one("abc", And(Equal("a"), Lookahead(Equal("c")), Equal("b"))) | |||
#TODO @test_throws ParserException parse_one("abc", And(Equal("a"), Lookahead(Equal("c")), Equal("b"))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
test/core/tests.jl
Outdated
@test parse_one("abc", Seq(p"."[1:2], p"."[1:2])) == ["a", "b", "c"] | ||
@test parse_one("abc", Seq(p"."[1:2,:&], p"."[1:2])) == Any[["a"], ["b"], "c"] | ||
@test parse_one("abc", Seq(p"."[1:2,:&,:?], p"."[1:2])) == Any[["a"], "b", "c"] | ||
@test_throws ErrorException parse_one("abc", Seq(p"."[1:2,:&,:?,:x], p"."[1:2])) | ||
#TODO @test_throws ErrorException parse_one("abc", Seq(p"."[1:2,:&,:?,:x], p"."[1:2])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
Hi, thanks for doing this, I got stucked at a certain point. There are a few tests that cuold/shoud be reactivated (where you see TODO), and some |
Thanks for the feedback. |
Bump. |
@andrewcooke could you grant write permissions to @oxinabox and me? |
@CarloLucibello can you review and merge if ready? |
tests are passing, although the output around this line looks not properly formatted. I don't know if it is just a problem with tests or we are really loosing something. If you manage to fix this good, otherwise let's just merge. |
I can't see any changes that could have been causing that on a quick look. But the last builds for the 0.5 current master don't screw up like that |
Oh did this never get merged? |
tests are passing and there are no warnings left. I think there are still some problems to be addressed though, some part of the tests' output looks incorrect:
|
@@ -33,7 +26,7 @@ function mk_parser(string_input) | |||
comment = P"(#.*)?" | |||
|
|||
# we need string input as we match multiple lines | |||
if string_input && ParserCombinator.FAST_REGEX |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@CarloLucibello Do you know why ParserCombinator.FAST_REGEX
was removed from this line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah becaue it is always true now
I can't workout (just from reading) what is causing all these extra displays. |
Ok this is building on #26 and #21
I'm not saying this is the prettiest code, but it passes all tests.
In a few places I got rid of inner constructors, and replaced them with outer constructors.
They are much more sensibly behaved, being just functions.
I'ld like to do that everywhere, but for now I am happy just to have it working.
I also drop all support for 0.5.
And remove Compat.
Its just easier to stop maintaining old versions (at least til 1.0) (In my opinion)
Particularly given this package is stable so the version to version difference is likely just deprecation fixes