mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Rename JULIA/IULIA to Yul in assembly interface
This commit is contained in:
@@ -99,7 +99,7 @@ bool AsmAnalyzer::operator()(assembly::Literal const& _literal)
|
||||
}
|
||||
else if (_literal.kind == assembly::LiteralKind::Boolean)
|
||||
{
|
||||
solAssert(m_flavour == AsmFlavour::IULIA, "");
|
||||
solAssert(m_flavour == AsmFlavour::Yul, "");
|
||||
solAssert(_literal.value == "true" || _literal.value == "false", "");
|
||||
}
|
||||
m_info.stackHeightInfo[&_literal] = m_stackHeight;
|
||||
@@ -162,7 +162,7 @@ bool AsmAnalyzer::operator()(assembly::Identifier const& _identifier)
|
||||
|
||||
bool AsmAnalyzer::operator()(FunctionalInstruction const& _instr)
|
||||
{
|
||||
solAssert(m_flavour != AsmFlavour::IULIA, "");
|
||||
solAssert(m_flavour != AsmFlavour::Yul, "");
|
||||
bool success = true;
|
||||
for (auto const& arg: _instr.arguments | boost::adaptors::reversed)
|
||||
if (!expectExpression(arg))
|
||||
@@ -550,7 +550,7 @@ Scope& AsmAnalyzer::scope(Block const* _block)
|
||||
}
|
||||
void AsmAnalyzer::expectValidType(string const& type, SourceLocation const& _location)
|
||||
{
|
||||
if (m_flavour != AsmFlavour::IULIA)
|
||||
if (m_flavour != AsmFlavour::Yul)
|
||||
return;
|
||||
|
||||
if (!builtinTypes.count(type))
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
/**
|
||||
* @author Christian <c@ethdev.com>
|
||||
* @date 2016
|
||||
* Forward declaration of classes for inline assembly / JULIA AST
|
||||
* Forward declaration of classes for inline assembly / Yul AST
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
@@ -57,7 +57,7 @@ enum class AsmFlavour
|
||||
{
|
||||
Loose, // no types, EVM instructions as function, jumps and direct stack manipulations
|
||||
Strict, // no types, EVM instructions as functions, but no jumps and no direct stack manipulations
|
||||
IULIA // same as Strict mode with types
|
||||
Yul // same as Strict mode with types
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -173,7 +173,7 @@ assembly::Statement Parser::parseStatement()
|
||||
if (currentToken() == Token::Assign && peekNextToken() != Token::Colon)
|
||||
{
|
||||
assembly::Assignment assignment = createWithLocation<assembly::Assignment>(identifier.location);
|
||||
if (m_flavour != AsmFlavour::IULIA && instructions().count(identifier.name))
|
||||
if (m_flavour != AsmFlavour::Yul && instructions().count(identifier.name))
|
||||
fatalParserError("Cannot use instruction names for identifier names.");
|
||||
advance();
|
||||
assignment.variableNames.emplace_back(identifier);
|
||||
@@ -357,7 +357,7 @@ Parser::ElementaryOperation Parser::parseElementaryOperation()
|
||||
else
|
||||
literal = currentLiteral();
|
||||
// first search the set of instructions.
|
||||
if (m_flavour != AsmFlavour::IULIA && instructions().count(literal))
|
||||
if (m_flavour != AsmFlavour::Yul && instructions().count(literal))
|
||||
{
|
||||
dev::solidity::Instruction const& instr = instructions().at(literal);
|
||||
ret = Instruction{location(), instr};
|
||||
@@ -398,7 +398,7 @@ Parser::ElementaryOperation Parser::parseElementaryOperation()
|
||||
""
|
||||
};
|
||||
advance();
|
||||
if (m_flavour == AsmFlavour::IULIA)
|
||||
if (m_flavour == AsmFlavour::Yul)
|
||||
{
|
||||
expectToken(Token::Colon);
|
||||
literal.location.end = endPosition();
|
||||
@@ -411,7 +411,7 @@ Parser::ElementaryOperation Parser::parseElementaryOperation()
|
||||
}
|
||||
default:
|
||||
fatalParserError(
|
||||
m_flavour == AsmFlavour::IULIA ?
|
||||
m_flavour == AsmFlavour::Yul ?
|
||||
"Literal or identifier expected." :
|
||||
"Literal, identifier or instruction expected."
|
||||
);
|
||||
@@ -481,7 +481,7 @@ assembly::Expression Parser::parseCall(Parser::ElementaryOperation&& _initialOp)
|
||||
RecursionGuard recursionGuard(*this);
|
||||
if (_initialOp.type() == typeid(Instruction))
|
||||
{
|
||||
solAssert(m_flavour != AsmFlavour::IULIA, "Instructions are invalid in JULIA");
|
||||
solAssert(m_flavour != AsmFlavour::Yul, "Instructions are invalid in Yul");
|
||||
Instruction& instruction = boost::get<Instruction>(_initialOp);
|
||||
FunctionalInstruction ret;
|
||||
ret.instruction = instruction.instruction;
|
||||
@@ -552,7 +552,7 @@ assembly::Expression Parser::parseCall(Parser::ElementaryOperation&& _initialOp)
|
||||
}
|
||||
else
|
||||
fatalParserError(
|
||||
m_flavour == AsmFlavour::IULIA ?
|
||||
m_flavour == AsmFlavour::Yul ?
|
||||
"Function name expected." :
|
||||
"Assembly instruction or function name required in front of \"(\")"
|
||||
);
|
||||
@@ -565,7 +565,7 @@ TypedName Parser::parseTypedName()
|
||||
RecursionGuard recursionGuard(*this);
|
||||
TypedName typedName = createWithLocation<TypedName>();
|
||||
typedName.name = expectAsmIdentifier();
|
||||
if (m_flavour == AsmFlavour::IULIA)
|
||||
if (m_flavour == AsmFlavour::Yul)
|
||||
{
|
||||
expectToken(Token::Colon);
|
||||
typedName.location.end = endPosition();
|
||||
@@ -577,7 +577,7 @@ TypedName Parser::parseTypedName()
|
||||
string Parser::expectAsmIdentifier()
|
||||
{
|
||||
string name = currentLiteral();
|
||||
if (m_flavour == AsmFlavour::IULIA)
|
||||
if (m_flavour == AsmFlavour::Yul)
|
||||
{
|
||||
switch (currentToken())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user