Skip to content

Commit

Permalink
adma are global variables
Browse files Browse the repository at this point in the history
  • Loading branch information
x87 committed Jan 8, 2023
1 parent db99235 commit d6af3d0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/parser/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ pub enum Variable {
impl Variable {
pub fn is_global(&self) -> bool {
match self {
Variable::Global(_) => true,
Variable::Global(_) | Variable::Adma(_) => true,
Variable::Indexed(v) if v.var.is_global() => true,
Variable::ArrayElement(v) if v.array_var.is_global() => true,
_ => false,
Expand Down
4 changes: 4 additions & 0 deletions src/v4/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ mod tests {
transform("$var = 5"),
Some(String::from("SET_VAR_INT $var 5"))
);
assert_eq!(
transform("&100 = 5"),
Some(String::from("SET_VAR_INT &100 5"))
);
assert_eq!(transform("0@ = 0"), Some(String::from("SET_LVAR_INT 0@ 0")));
assert_eq!(
transform("$var[10] = 5.0"),
Expand Down

0 comments on commit d6af3d0

Please sign in to comment.