Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

feat(rome_js_analyze): noLabelVar #2838

Merged
merged 11 commits into from
Jul 11, 2022
Merged

Conversation

IWANABETHATGUY
Copy link
Contributor

Summary

  1. Resolved noLabelVar #2837

Test Plan

  1. Should pass the new snapshot test

@@ -48,7 +48,7 @@ fn generate_module(name: &'static str, entries: &mut Vec<String>) -> Result<()>
let rule_name = format_ident!("{}", rule_name);

rules.insert(
index,
index.min(rules.len()),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The index may be out of bounds of rules vector. Because index is the binary search result of entries, which length is always greater equal to the rules's. So we need to use index.min(rules.len() to avoid out of bounds insertion.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this is due to the entries vector now being shared between analyzers and semantic_analyzers, I have a proper fix for this ready as part of the refactor adding rule groups

@ematipico ematipico requested review from leops and xunilrj July 8, 2022 07:33
@IWANABETHATGUY
Copy link
Contributor Author

Don't merge for now, the current implementation is not efficient, I will optimize it.

@IWANABETHATGUY
Copy link
Contributor Author

This could be merged once #2841 is merged.

@xunilrj
Copy link
Contributor

xunilrj commented Jul 8, 2022

This could be merged once #2841 is merged.

Done.

@IWANABETHATGUY
Copy link
Contributor Author

This could be merged once #2841 is merged.

Done.

NIce.

IWANABETHATGUY and others added 4 commits July 9, 2022 00:17
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
@ematipico ematipico merged commit d9c3432 into rome:main Jul 11, 2022
@IWANABETHATGUY IWANABETHATGUY deleted the feat/no-label-var branch July 11, 2022 12:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

noLabelVar
4 participants