Skip to content

Commit

Permalink
fix #34
Browse files Browse the repository at this point in the history
  • Loading branch information
duaraghav8 committed Jan 5, 2019
1 parent 100815e commit 8cbb9c1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
16 changes: 4 additions & 12 deletions solidity.pegjs
Original file line number Diff line number Diff line change
Expand Up @@ -1808,38 +1808,30 @@ AssemblyFunctionDefinition
}

AssemblyLocalBinding
= 'let' __ name:Identifier expression:(__ ':=' __ AssemblyExpression)? {
= 'let' __ names:AssemblyIdentifierList expression:(__ ':=' __ AssemblyExpression)? {
if (expression != null) {
expression = expression[3];
}

return {
type: "AssemblyLocalBinding",
name: name,
names: names,
expression: expression,
start: location().start.offset,
end: location().end.offset
}
}

AssemblyAssignment
= name:Identifier __ ':=' __ expression:AssemblyExpression {
= names:AssemblyIdentifierList __ ':=' __ expression:AssemblyExpression {
return {
type: "AssemblyAssignment",
name: name,
names: names,
expression: expression,
start: location().start.offset,
end: location().end.offset
}
}
/ '=:' __ name:Identifier {
return {
type: "AssemblyAssignment",
name: name,
start: location().start.offset,
end: location().end.offset
}
}

ReturnOpCode
= 'return' {
Expand Down
2 changes: 2 additions & 0 deletions test/doc_examples.sol
Original file line number Diff line number Diff line change
Expand Up @@ -383,12 +383,14 @@ contract assemblyLocalBinding {
let x := 0x00
let y := x
let z := "hello"
let a, bcd, efgh := callMyFunc()

a := 0
b := 90172
c := myVariable
d := foobar()
e := "lala"
x, yz, abc := somerandomfunc()
}
}
}
Expand Down

0 comments on commit 8cbb9c1

Please sign in to comment.