Fix token conflict detection bugs
This commit is contained in:
parent
ae07d2d6e4
commit
e4b9d9dfa9
4 changed files with 8 additions and 9 deletions
|
|
@ -236,7 +236,7 @@ impl<'a> ParseItemSet<'a> {
|
|||
Err(i) => {
|
||||
self.entries.insert(i, (item, lookaheads.clone()));
|
||||
&mut self.entries[i].1
|
||||
},
|
||||
}
|
||||
Ok(i) => {
|
||||
self.entries[i].1.insert_all(lookaheads);
|
||||
&mut self.entries[i].1
|
||||
|
|
@ -248,8 +248,9 @@ impl<'a> ParseItemSet<'a> {
|
|||
let mut previous_variable_index = u32::MAX;
|
||||
let mut previous_step_index = u32::MAX;
|
||||
for (item, _) in self.entries.iter() {
|
||||
if item.step().is_none() && item.variable_index != previous_variable_index
|
||||
|| item.step_index != previous_step_index
|
||||
if item.step().is_some()
|
||||
&& (item.variable_index != previous_variable_index
|
||||
|| item.step_index != previous_step_index)
|
||||
{
|
||||
h.write_u32(item.variable_index);
|
||||
h.write_u32(item.step_index);
|
||||
|
|
|
|||
|
|
@ -228,8 +228,9 @@ impl<'a> Minimizer<'a> {
|
|||
// Do not add a token if it conflicts with an existing token.
|
||||
if token.is_terminal() {
|
||||
for existing_token in state.terminal_entries.keys() {
|
||||
if (is_word_token && self.keywords.contains(existing_token))
|
||||
|| is_keyword && self.syntax_grammar.word_token.as_ref() == Some(existing_token)
|
||||
if (is_word_token || is_keyword)
|
||||
&& (self.keywords.contains(existing_token)
|
||||
|| self.syntax_grammar.word_token.as_ref() == Some(existing_token))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -232,7 +232,7 @@ fn identify_keywords(
|
|||
.filter(|token| {
|
||||
for other_token in keywords.iter() {
|
||||
if other_token != *token
|
||||
&& token_conflict_map.does_match_same_string(token.index, other_token.index)
|
||||
&& token_conflict_map.does_match_same_string(other_token.index, token.index)
|
||||
{
|
||||
info!(
|
||||
"Keywords - exclude {} because it matches the same string as {}",
|
||||
|
|
|
|||
|
|
@ -167,9 +167,6 @@ impl Loader {
|
|||
}
|
||||
|
||||
if cfg!(windows) {
|
||||
if !BUILD_TARGET.contains("64") {
|
||||
command.env("Platform", "x86");
|
||||
}
|
||||
command
|
||||
.args(&["/nologo", "/LD", "/I"])
|
||||
.arg(header_path)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue