basic access
This commit is contained in:
parent
11145e278b
commit
0da1c14ed7
2 changed files with 35 additions and 4 deletions
35
src/Bofa.bf
35
src/Bofa.bf
|
@ -60,7 +60,7 @@ class Bofa
|
|||
case .BigInteger:
|
||||
strBuffer.Append(scope $"bi {Name} {Value.BigInteger}");
|
||||
case .BigNumber:
|
||||
strBuffer.Append(scope $"bn {Name} {Value.BigNumber}");
|
||||
strBuffer.Append(scope $"bn {Name} {Value.BigNumber:R}");
|
||||
case .Boolean:
|
||||
strBuffer.Append(scope $"b {Name} {Value.Boolean ? "true" : "false"}");
|
||||
case .Custom:
|
||||
|
@ -70,7 +70,7 @@ class Bofa
|
|||
case .Line:
|
||||
strBuffer.Append(scope $"l {Name} {Value.Line}");
|
||||
case .Number:
|
||||
strBuffer.Append(scope $"n {Name} {Value.Number}");
|
||||
strBuffer.Append(scope $"n {Name} {Value.Number:R}");
|
||||
case .Object:
|
||||
strBuffer.Append(scope $"o {Name}");
|
||||
case .Text:
|
||||
|
@ -152,4 +152,35 @@ class Bofa
|
|||
else if(Type == .Array)
|
||||
DeleteContainerAndItems!(Value.Array);
|
||||
}
|
||||
|
||||
public ref Bofa this[StringView view]
|
||||
{
|
||||
[Checked]
|
||||
get
|
||||
{
|
||||
Runtime.Assert(Type == .Object);
|
||||
Runtime.Assert(Value.Object.ContainsKey(view));
|
||||
return ref Value.Object[view];
|
||||
}
|
||||
|
||||
[Unchecked, Inline]
|
||||
get
|
||||
{
|
||||
return ref Value.Object[view];
|
||||
}
|
||||
|
||||
[Checked]
|
||||
set
|
||||
{
|
||||
Runtime.Assert(Type == .Object);
|
||||
Runtime.Assert(!Value.Object.ContainsKey(view));
|
||||
Value.Object[view] = value;
|
||||
}
|
||||
|
||||
[Unchecked, Inline]
|
||||
set
|
||||
{
|
||||
Value.Object[view] = value;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -16,7 +16,7 @@ class Consistency
|
|||
t textgoes here
|
||||
- Text addendum
|
||||
n tone 12.5
|
||||
bn biggie 6.56456e+10
|
||||
bn biggie 65645654535.553001
|
||||
i int 234345
|
||||
bi bint 38432847329847329
|
||||
o object
|
||||
|
@ -32,7 +32,7 @@ class Consistency
|
|||
String s = scope .();
|
||||
for(var i in output)
|
||||
{
|
||||
i.value.ToString(s);
|
||||
i.value.ToString(s);
|
||||
s.Append('\n');
|
||||
}
|
||||
s.RemoveFromEnd(1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue