Added default pin connection rule

This commit is contained in:
Borna Rajkovic committed 2022-04-09 14:10:40 +02:00
1 parent dfc7bf48dc
commit 7fcfb8c977
6 files changed
+35 -5

No files matched your search

+1
View File
@@ -264,6 +264,7 @@ struct PinNode: AstNode
std::optional<StringNode> tooltip;
std::optional<PinConnectionNode> connection;
std::optional<DisplayNode> display;
std::optional<std::vector<ValueNode>> wires;
};
+6
View File
@@ -634,6 +634,12 @@ PResult<PinNode> ComdelParser::parsePin() {
ASSIGN_OR_RETURN_IF_ERR(pin.display, parseDisplay());
} else if (check(TokenType::KW_CONNECTION)) {
ASSIGN_OR_RETURN_IF_ERR(pin.connection, parsePinConnection());
} else if (check(TokenType::KW_WIRES)){
bump();
auto wires = parseList<ValueNode>(std::optional<TokenType>(TokenType::LBRACE), TokenType::RBRACE, std::optional<TokenType>(TokenType::COMMA), false,
[this] { return parseConnectionWire(); });
RETURN_IF_ERR(wires);
pin.wires = *wires;
} else {
return unexpected();
}