-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Upgrade terminfo #7133
Upgrade terminfo #7133
Conversation
Take a new struct Variables instead of two &mut [] vectors for static and dynamic variables.
Replace all potentially-failing operations with Err returns and add tests. Remove the Char parameter type; characters are represented as Numbers. Fix integer constants to work properly when there are multiple constants in the same capability string. Tweak loop to use iterators instead of indexing into cap.
Implement the %?, %t, %e, and %; operators. Also implement the %<, %=, %> operators, without which conditionals aren't very useful. Fix the order of parameters for the arithmetic operators. Implement the missing %^ operator.
r? @thestinger |
Implement conditional support in terminfo, along with a few other related operators. Fix implementation of non-commutative arithmetic operators. Remove all known cases of task failure from `terminfo::parm::expand`, and change the method signature. Fix some other miscellaneous issues.
_ => return Err(~"non-number on stack with %~") | ||
} | ||
} else { return Err(~"stack is empty") }, | ||
'i' => match (copy mparams[0], copy mparams[1]) { |
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.
It's a bit late for this, but does this do the correct thing? I would've though the copy
means that mparams[0]
and mparams[1]
are not modified by the +=
's below.
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.
Hah, good point. I don't think the tests covered this case.
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 submitted #7160 to fix this
Add `needless_bitwise_bool` lint fixes rust-lang#6827 fixes rust-lang#1594 changelog: Add ``[`needless_bitwise_bool`]`` lint Creates a new `bitwise_bool` lint to convert `x & y` to `x && y` when both `x` and `y` are booleans. I also had to adjust thh `needless_bool` lint slightly, and fix a couple failing dogfood tests. I made it a correctness lint as per flip1995's comment [here](rust-lang/rust-clippy#3385 (comment)), from a previous WIP attempt at this lint.
Implement conditional support in terminfo, along with a few other related operators.
Fix implementation of non-commutative arithmetic operators.
Remove all known cases of task failure from
terminfo::parm::expand
, and change the method signature.Fix some other miscellaneous issues.