File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1690,6 +1690,9 @@ public class FuSystem : FuScope
16901690 Add(LongType);
16911691 ByteType.Name = "byte";
16921692 Add(ByteType);
1693+ FuRangeType# sByteType = FuRangeType.New(-0x80, 0x7f);
1694+ sByteType.Name = "sbyte";
1695+ Add(sByteType);
16931696 FuRangeType# shortType = FuRangeType.New(-0x8000, 0x7fff);
16941697 shortType.Name = "short";
16951698 Add(shortType);
Original file line number Diff line number Diff line change @@ -561,7 +561,7 @@ public abstract class FuLexer
561561 case ';': return FuToken.Semicolon;
562562 case '.':
563563 if (PeekChar() == '.')
564- ReportError("Range types have been removed - replace with byte/short/ushort/int/uint");
564+ ReportError("Range types have been removed - replace with byte/sbyte/ short/ushort/int/uint");
565565 return FuToken.Dot;
566566 case ',': return FuToken.Comma;
567567 case '(': return FuToken.LeftParenthesis;
Original file line number Diff line number Diff line change @@ -66,6 +66,7 @@ These are the available integer types:
6666| Type | Min value | Max value |
6767| -------- | -------------------: | ------------------: |
6868| ` byte ` | 0 | 255 |
69+ | ` sbyte ` | -128 | 127 |
6970| ` short ` | -32768 | 32767 |
7071| ` ushort ` | 0 | 65535 |
7172| ` int ` | -2147483648 | 2147483647 |
Original file line number Diff line number Diff line change 2525 <Keywords name =" Folders in comment, middle" ></Keywords >
2626 <Keywords name =" Folders in comment, close" ></Keywords >
2727 <Keywords name =" Keywords1" >abstract assert base break case class const continue default do else enum false for foreach if in internal is lock native new null override protected public resource return sealed static switch this throw throws true virtual when while</Keywords >
28- <Keywords name =" Keywords2" >bool byte double float int long nint short string uint ushort void</Keywords >
28+ <Keywords name =" Keywords2" >bool byte double float int long nint sbyte short string uint ushort void</Keywords >
2929 <Keywords name =" Keywords3" >Console Convert Dictionary Encoding Environment Exception HashSet JsonElement List Lock Match Math OrderedDictionary PriorityQueue Queue Regex RegexOptions SortedDictionary SortedSet Stack StringWriter TextWriter</Keywords >
3030 <Keywords name =" Keywords4" >#elif #else #endif #if</Keywords >
3131 <Keywords name =" Keywords5" ></Keywords >
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ class const continue default do double else enum \
1414false float for foreach if \
1515in int internal is lock long native new nint null \
1616override protected public \
17- resource return sealed short static \
17+ resource return sbyte sealed short static \
1818string switch this throw throws true uint \
1919ushort virtual void when while
2020keywords.$(file.patterns.fu) =$(keywordclass.fu)
Original file line number Diff line number Diff line change 13481348 <key >type-builtin </key >
13491349 <dict >
13501350 <key >match </key >
1351- <string >\b(bool|byte|double|float|int|long|nint|short|string|uint|ushort|void)\b </string >
1351+ <string >\b(bool|byte|double|float|int|long|nint|sbyte| short|string|uint|ushort|void)\b </string >
13521352 <key >captures </key >
13531353 <dict >
13541354 <key >1 </key >
Original file line number Diff line number Diff line change 894894 ]
895895 },
896896 "type-builtin" : {
897- "match" : " \\ b(bool|byte|double|float|int|long|nint|short|string|uint|ushort|void)\\ b" ,
897+ "match" : " \\ b(bool|byte|double|float|int|long|nint|sbyte| short|string|uint|ushort|void)\\ b" ,
898898 "captures" : {
899899 "1" : {
900900 "name" : " keyword.type.fu"
Original file line number Diff line number Diff line change @@ -451,7 +451,7 @@ FuToken FuLexer::readPreToken()
451451 return FuToken::semicolon;
452452 case '.':
453453 if (peekChar() == '.')
454- reportError("Range types have been removed - replace with byte/short/ushort/int/uint");
454+ reportError("Range types have been removed - replace with byte/sbyte/ short/ushort/int/uint");
455455 return FuToken::dot;
456456 case ',':
457457 return FuToken::comma;
@@ -2751,6 +2751,9 @@ FuSystem::FuSystem()
27512751 add(this->longType);
27522752 this->byteType->name = "byte";
27532753 add(this->byteType);
2754+ std::shared_ptr<FuRangeType> sByteType = FuRangeType::new_(-128, 127);
2755+ sByteType->name = "sbyte";
2756+ add(sByteType);
27542757 std::shared_ptr<FuRangeType> shortType = FuRangeType::new_(-32768, 32767);
27552758 shortType->name = "short";
27562759 add(shortType);
Original file line number Diff line number Diff line change @@ -576,7 +576,7 @@ FuToken ReadPreToken()
576576 return FuToken.Semicolon;
577577 case '.':
578578 if (PeekChar() == '.')
579- ReportError("Range types have been removed - replace with byte/short/ushort/int/uint");
579+ ReportError("Range types have been removed - replace with byte/sbyte/ short/ushort/int/uint");
580580 return FuToken.Dot;
581581 case ',':
582582 return FuToken.Comma;
@@ -3239,6 +3239,9 @@ internal FuSystem()
32393239 Add(this.LongType);
32403240 this.ByteType.Name = "byte";
32413241 Add(this.ByteType);
3242+ FuRangeType sByteType = FuRangeType.New(-128, 127);
3243+ sByteType.Name = "sbyte";
3244+ Add(sByteType);
32423245 FuRangeType shortType = FuRangeType.New(-32768, 32767);
32433246 shortType.Name = "short";
32443247 Add(shortType);
Original file line number Diff line number Diff line change @@ -562,7 +562,7 @@ export class FuLexer
562562 return FuToken.SEMICOLON;
563563 case 46:
564564 if (this.peekChar() == 46)
565- this.reportError("Range types have been removed - replace with byte/short/ushort/int/uint");
565+ this.reportError("Range types have been removed - replace with byte/sbyte/ short/ushort/int/uint");
566566 return FuToken.DOT;
567567 case 44:
568568 return FuToken.COMMA;
@@ -3481,6 +3481,9 @@ export class FuSystem extends FuScope
34813481 this.add(this.longType);
34823482 this.byteType.name = "byte";
34833483 this.add(this.byteType);
3484+ let sByteType = FuRangeType.new(-128, 127);
3485+ sByteType.name = "sbyte";
3486+ this.add(sByteType);
34843487 let shortType = FuRangeType.new(-32768, 32767);
34853488 shortType.name = "short";
34863489 this.add(shortType);
You can’t perform that action at this time.
0 commit comments