Skip to content

Commit b3b5f5a

Browse files
committed
feat: support multi-values attributes
1 parent 4f15be2 commit b3b5f5a

15 files changed

Lines changed: 275 additions & 67 deletions

src/main/gen/com/github/xepozz/gitattributes/language/parser/AttributesLexer.java

Lines changed: 39 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,10 @@ private static int zzUnpackcmap_top(String packed, int offset, int [] result) {
6767

6868
private static final String ZZ_CMAP_BLOCKS_PACKED_0 =
6969
"\11\0\1\1\1\2\2\3\1\4\22\0\1\1\2\0"+
70-
"\1\5\11\0\1\6\17\0\1\7\36\0\1\10\50\0"+
71-
"\1\3\32\0\1\3\u01df\0\1\3\177\0\13\3\35\0"+
72-
"\2\3\5\0\1\3\57\0\1\3\240\0\1\3\377\0";
70+
"\1\5\10\0\1\6\1\7\17\0\1\10\36\0\1\11"+
71+
"\50\0\1\3\32\0\1\3\u01df\0\1\3\177\0\13\3"+
72+
"\35\0\2\3\5\0\1\3\57\0\1\3\240\0\1\3"+
73+
"\377\0";
7374

7475
private static int [] zzUnpackcmap_blocks() {
7576
int [] result = new int[1280];
@@ -97,10 +98,11 @@ private static int zzUnpackcmap_blocks(String packed, int offset, int [] result)
9798

9899
private static final String ZZ_ACTION_PACKED_0 =
99100
"\3\0\1\1\1\2\1\3\1\4\1\5\1\1\1\6"+
100-
"\1\7\2\6\1\10\1\11\1\5\1\0\1\5\1\1";
101+
"\1\7\2\6\1\10\1\11\1\12\1\5\1\0\1\5"+
102+
"\1\1";
101103

102104
private static int [] zzUnpackAction() {
103-
int [] result = new int[19];
105+
int [] result = new int[20];
104106
int offset = 0;
105107
offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result);
106108
return result;
@@ -125,12 +127,12 @@ private static int zzUnpackAction(String packed, int offset, int [] result) {
125127
private static final int [] ZZ_ROWMAP = zzUnpackRowMap();
126128

127129
private static final String ZZ_ROWMAP_PACKED_0 =
128-
"\0\0\0\11\0\22\0\33\0\44\0\55\0\66\0\77"+
129-
"\0\110\0\121\0\132\0\143\0\154\0\66\0\66\0\165"+
130-
"\0\176\0\207\0\220";
130+
"\0\0\0\12\0\24\0\36\0\50\0\62\0\74\0\106"+
131+
"\0\120\0\132\0\144\0\156\0\170\0\74\0\74\0\74"+
132+
"\0\202\0\214\0\226\0\240";
131133

132134
private static int [] zzUnpackRowMap() {
133-
int [] result = new int[19];
135+
int [] result = new int[20];
134136
int offset = 0;
135137
offset = zzUnpackRowMap(ZZ_ROWMAP_PACKED_0, offset, result);
136138
return result;
@@ -153,18 +155,19 @@ private static int zzUnpackRowMap(String packed, int offset, int [] result) {
153155
private static final int [] ZZ_TRANS = zzUnpacktrans();
154156

155157
private static final String ZZ_TRANS_PACKED_0 =
156-
"\1\4\1\5\1\6\1\7\1\6\1\10\2\4\1\11"+
157-
"\1\12\1\13\1\6\1\7\1\6\3\12\1\14\1\15"+
158-
"\1\5\1\6\1\7\1\6\1\15\1\16\1\17\1\15"+
159-
"\1\4\4\0\3\4\1\11\1\0\1\5\11\0\1\6"+
160-
"\1\0\1\6\15\0\1\10\1\20\1\21\2\20\3\10"+
161-
"\1\22\10\4\1\11\1\12\4\0\3\12\1\14\1\0"+
162-
"\1\13\7\0\10\12\1\14\1\15\4\0\2\15\1\0"+
163-
"\1\15\2\20\1\21\6\20\5\0\1\20\3\0\2\10"+
164-
"\1\23\5\10\1\22\1\4\4\0\1\10\2\4\1\11";
158+
"\1\4\1\5\1\6\1\7\1\6\1\10\3\4\1\11"+
159+
"\1\12\1\13\1\6\1\7\1\6\4\12\1\14\1\15"+
160+
"\1\5\1\6\1\7\1\6\1\15\1\16\1\17\1\20"+
161+
"\1\15\1\4\4\0\4\4\1\11\1\0\1\5\12\0"+
162+
"\1\6\1\0\1\6\17\0\1\10\1\21\1\22\2\21"+
163+
"\4\10\1\23\11\4\1\11\1\12\4\0\4\12\1\14"+
164+
"\1\0\1\13\10\0\11\12\1\14\1\15\4\0\1\15"+
165+
"\1\0\1\15\1\0\1\15\2\21\1\22\7\21\5\0"+
166+
"\1\21\4\0\2\10\1\24\6\10\1\23\1\4\4\0"+
167+
"\1\10\3\4\1\11";
165168

166169
private static int [] zzUnpacktrans() {
167-
int [] result = new int[153];
170+
int [] result = new int[170];
168171
int offset = 0;
169172
offset = zzUnpacktrans(ZZ_TRANS_PACKED_0, offset, result);
170173
return result;
@@ -202,10 +205,10 @@ private static int zzUnpacktrans(String packed, int offset, int [] result) {
202205
private static final int [] ZZ_ATTRIBUTE = zzUnpackAttribute();
203206

204207
private static final String ZZ_ATTRIBUTE_PACKED_0 =
205-
"\3\0\3\1\1\11\6\1\2\11\1\1\1\0\2\1";
208+
"\3\0\3\1\1\11\6\1\3\11\1\1\1\0\2\1";
206209

207210
private static int [] zzUnpackAttribute() {
208-
int [] result = new int[19];
211+
int [] result = new int[20];
209212
int offset = 0;
210213
offset = zzUnpackAttribute(ZZ_ATTRIBUTE_PACKED_0, offset, result);
211214
return result;
@@ -530,47 +533,52 @@ else if (zzAtEOF) {
530533
{ yypushback(0); yybegin(PATTERN); return AttributesTypes.TEXT;
531534
}
532535
// fall through
533-
case 10: break;
536+
case 11: break;
534537
case 2:
535538
{ return TokenType.WHITE_SPACE;
536539
}
537540
// fall through
538-
case 11: break;
541+
case 12: break;
539542
case 3:
540543
{ yybegin(YYINITIAL); return AttributesTypes.EOL;
541544
}
542545
// fall through
543-
case 12: break;
546+
case 13: break;
544547
case 4:
545548
{ return TokenType.BAD_CHARACTER;
546549
}
547550
// fall through
548-
case 13: break;
551+
case 14: break;
549552
case 5:
550553
{ return AttributesTypes.COMMENT;
551554
}
552555
// fall through
553-
case 14: break;
556+
case 15: break;
554557
case 6:
555558
{ return AttributesTypes.TEXT;
556559
}
557560
// fall through
558-
case 15: break;
561+
case 16: break;
559562
case 7:
560563
{ yybegin(ATTRIBUTES); return TokenType.WHITE_SPACE;
561564
}
562565
// fall through
563-
case 16: break;
566+
case 17: break;
564567
case 8:
565-
{ return AttributesTypes.DASH;
568+
{ return AttributesTypes.COMMA;
566569
}
567570
// fall through
568-
case 17: break;
571+
case 18: break;
569572
case 9:
573+
{ return AttributesTypes.DASH;
574+
}
575+
// fall through
576+
case 19: break;
577+
case 10:
570578
{ return AttributesTypes.EQUALS_SIGN;
571579
}
572580
// fall through
573-
case 18: break;
581+
case 20: break;
574582
default:
575583
zzScanError(ZZ_NO_MATCH);
576584
}

src/main/gen/com/github/xepozz/gitattributes/language/parser/AttributesParser.java

Lines changed: 84 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/gen/com/github/xepozz/gitattributes/language/psi/AttributesAttribute.java

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/gen/com/github/xepozz/gitattributes/language/psi/AttributesAttributeName.java

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/gen/com/github/xepozz/gitattributes/language/psi/AttributesAttributeValue.java

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/gen/com/github/xepozz/gitattributes/language/psi/AttributesAttributeValues.java

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/gen/com/github/xepozz/gitattributes/language/psi/AttributesTypes.java

Lines changed: 13 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)