Skip to content

Commit

Permalink
Add chord comment style
Browse files Browse the repository at this point in the history
  • Loading branch information
gaborsch committed Mar 22, 2024
1 parent 297309d commit 75001fc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/rockstar/parser/MultilineReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public class MultilineReader {
int tokenStartPos = -1;

boolean isInComment = false;
char commentStyle;
boolean isInQuote = false;
boolean isInNumber = false;
boolean wasApos = false;
Expand Down Expand Up @@ -80,7 +81,9 @@ private String readBuffer() throws IOException {
private void processChar(char c) {
if (isInComment) {
// in bracket comment
if (c == ')') {
if ((commentStyle == '(' && c == ')')
|| (commentStyle == '[' && c == ']')
|| (commentStyle == '{' && c == '}')) {
isInComment = false;
}
return;
Expand Down Expand Up @@ -109,7 +112,10 @@ private void processChar(char c) {
addToken(0);
break;
case '(':
case '[':
case '{':
isInComment = true;
commentStyle = c;
addToken(0);
break;
case '"':
Expand Down

0 comments on commit 75001fc

Please sign in to comment.