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

Commit

Permalink
fix: incorrect macro expansion delta
Browse files Browse the repository at this point in the history
  • Loading branch information
Sarrus1 committed Jul 18, 2023
1 parent 5a6d579 commit 8095d45
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/sourcepawn_preprocessor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ mod test {
_macros: &mut FxHashMap<String, Macro>,
mut _path: String,
_document_uri: &Url,
) {
_quoted: bool,
) -> anyhow::Result<()> {
Ok(())
}

use super::{evaluator::IfCondition, preprocessor::Macro, SourcepawnPreprocessor};
Expand Down
6 changes: 3 additions & 3 deletions src/sourcepawn_preprocessor/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,10 @@ fn expand_macro(
if arg_idx >= 10 {
return Err(ParseIntError::new(child.text(), child.range));
}
for (i, child) in args[arg_idx as usize].iter().enumerate() {
for (j, sub_child) in args[arg_idx as usize].iter().enumerate() {
stack.push((
child.clone(),
if i == 0 { symbol.delta } else { child.delta },
sub_child.clone(),
if j == 0 { child.delta } else { sub_child.delta },
d + 1,
));
}
Expand Down

0 comments on commit 8095d45

Please sign in to comment.