-
Notifications
You must be signed in to change notification settings - Fork 15
Literal: Remove null and boolean parsers #104
Conversation
2 similar comments
4 similar comments
@@ -722,78 +640,6 @@ mod tests { | |||
}; | |||
|
|||
#[test] | |||
fn case_null() { | |||
let input = Span::new(b"null"); |
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.
You should move these tests where constants are used, so in qualified_name
.
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.
Should all of these tests be moved? I am not sure if they are just redundant then, in particular since a test for unqualified names already exists:
Lines 242 to 248 in ff0ca1f
#[test] | |
fn case_unqualified_name() { | |
let input = Span::new(b"Foo"); | |
let output = Result::Done(Span::new_at(b"", 3, 1, 4), Name::Unqualified(input)); | |
assert_eq!(qualified_name(input), output); | |
} |
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.
I guess it's better to ensure that special constants are correctly parsed ;-). So I prefer to keep them.
@Hywan Do you have an idea why suddenly the tests for Rust 1.14 failed? https://travis-ci.org/tagua-vm/parser/jobs/234969027 |
A dependency is breaking our build. Continue, I will fix it on my end. |
@Hywan Did you seen my response to your comment on the code? #104 (comment) :) |
@Acconut Done. |
Added back the tests. |
Is it ready for a review? |
Yes, indeed :) |
I have a bad news for you. Yes, according to the grammar,
So, as far as I understand, they are qualified names with special treatements. Thus, my conclusion would be to keep them right now, and see if it raises some errors in existing test suites from Zend or HHVM. What do you think? I am sorry it comes to my mind riht now after all your work. Maybe an input from @nikic or @jubianchi would confirm. |
That's interesting, I wasn't aware of this fact. And you don't have to apologize, it's better to think of this now than later :) Another option, I could think of is treat them similar to how magic constants, such as LINE may be implemented (see http://php.net/manual/en/language.constants.predefined.php). They could be parsed as qualified names but have a special treatment. |
@Hywan Haven't followed the context here, but please note that while |
Thanks! |
Addresses #93.