Skip to content

Commit

Permalink
Tokenize commas.
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaloney-sf committed Jun 19, 2024
1 parent ae89735 commit 15b0c09
Show file tree
Hide file tree
Showing 4 changed files with 157 additions and 31 deletions.
2 changes: 1 addition & 1 deletion lib/Dialect/FIRRTL/Export/FIREmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1003,7 +1003,7 @@ void Emitter::emitStatement(SeqMemOp op) {
ps.scopedBox(PP::ibox2, [&]() {
ps << "smem " << PPExtString(legalize(op.getNameAttr()));
emitTypeWithColon(op.getType());
ps << PP::space;
ps << "," << PP::space;
emitAttribute(op.getRuw());
});
emitLocationAndNewLine(op);
Expand Down
7 changes: 3 additions & 4 deletions lib/Dialect/FIRRTL/Import/FIRLexer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,7 @@ std::optional<unsigned> FIRLexer::getIndentation(const FIRToken &tok) const {
// Count the number of horizontal whitespace characters before the token.
auto *bufStart = curBuffer.begin();

auto isHorizontalWS = [](char c) -> bool {
return c == ' ' || c == '\t' || c == ',';
};
auto isHorizontalWS = [](char c) -> bool { return c == ' ' || c == '\t'; };
auto isVerticalWS = [](char c) -> bool {
return c == '\n' || c == '\r' || c == '\f' || c == '\v';
};
Expand Down Expand Up @@ -233,7 +231,6 @@ FIRToken FIRLexer::lexTokenImpl() {
case '\t':
case '\n':
case '\r':
case ',':
// Handle whitespace.
continue;

Expand All @@ -244,6 +241,8 @@ FIRToken FIRLexer::lexTokenImpl() {

case '.':
return formToken(FIRToken::period, tokStart);
case ',':
return formToken(FIRToken::comma, tokStart);
case ':':
return formToken(FIRToken::colon, tokStart);
case '(':
Expand Down
Loading

0 comments on commit 15b0c09

Please sign in to comment.