Skip to content

Commit

Permalink
Fixed parsing derefs
Browse files Browse the repository at this point in the history
  • Loading branch information
leventeBajczi committed Nov 12, 2024
1 parent f639718 commit 0d4e531
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 4 additions & 4 deletions subprojects/common/grammar/src/main/antlr/CommonTokens.g4
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,6 @@ MINUS
: '-'
;

MUL : '*'
;

DIV : 'div'
;

Expand Down Expand Up @@ -406,7 +403,10 @@ SIGN: PLUS | MINUS
DOT : '.'
;

ID : (LETTER | UNDERSCORE) (LETTER | UNDERSCORE | '$' | DIGIT | COLON)*
ID : (LETTER | UNDERSCORE) (LETTER | UNDERSCORE | '$' | '*' | DIGIT | COLON)*
;

MUL : '*'
;

UNDERSCORE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class ExprTest {
fun data(): Collection<Array<Any>> {
val x = Var("x", Int())
val p = Param("p", Int())
val casret = Var("thr1::casret*", Int())

val bvLit1 = Bv(BooleanArray(4) { it % 2 == 0 })
val bvLit2 = Bv(BooleanArray(4) { it % 2 == 1 })
Expand Down Expand Up @@ -286,6 +287,11 @@ class ExprTest {
emptyMap<Symbol, Decl<*>>(),
),
arrayOf(Dereference(Int(0), Int(1), Int()), "(deref 0 1 Int)", emptyMap<Symbol, Decl<*>>()),
arrayOf(
Dereference(casret.ref, Int(0), Int()),
"(deref thr1::casret* 0 Int)",
mapOf(Pair(NamedSymbol("thr1::casret*"), casret)),
),
)
}
}
Expand Down

0 comments on commit 0d4e531

Please sign in to comment.