Skip to content

Commit b1b3102

Browse files
committed
fix tabs/spaces, use aliases
1 parent 9670d6b commit b1b3102

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/JSON.pkg.vhdl

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ package body JSON is
277277
end procedure;
278278

279279
impure function decode(Stream : STRING) return STRING is
280-
constant str : string(1 to Stream'length) := Stream;
280+
alias str : string(1 to Stream'length) is Stream;
281281
begin
282282
case str(1) is
283283
when '{'|'['|'.'|'/'|'\' =>
@@ -288,10 +288,10 @@ package body JSON is
288288
end if;
289289
return base16_decode(str);
290290
end case;
291-
end;
291+
end function;
292292

293293
impure function jsonLoad(Stream : STRING) return T_JSON is
294-
constant str : string(1 to Stream'length) := Stream;
294+
alias str : string(1 to Stream'length) is Stream;
295295
constant raw : string := decode(str);
296296
begin
297297
if ( ".json" = raw(raw'length-4 to raw'length) ) then
@@ -1641,22 +1641,22 @@ package body JSON is
16411641

16421642
-- function to get a integer_vector from the compressed content extracted from a JSON input
16431643
function jsonGetIntegerArray(JSONContext : T_JSON; Path : string) return integer_vector is
1644-
variable len: natural:=0;
1644+
variable len: natural := 0;
16451645
begin
1646-
while jsonIsNumber(JSONContext, Path & "/" & to_string(len)) loop
1647-
len := len+1;
1648-
end loop;
1649-
return jsonGetIntegerArray(JSONContext, Path, len);
1650-
end;
1646+
while jsonIsNumber(JSONContext, Path & "/" & to_string(len)) loop
1647+
len := len+1;
1648+
end loop;
1649+
return jsonGetIntegerArray(JSONContext, Path, len);
1650+
end function;
16511651

16521652
-- function to get a integer_vector of a fixed length from the compressed content extracted from a JSON input
16531653
function jsonGetIntegerArray(JSONContext : T_JSON; Path : string; Len : positive) return integer_vector is
1654-
variable return_value : integer_vector(Len-1 downto 0);
1654+
variable return_value : integer_vector(Len-1 downto 0);
16551655
begin
1656-
for i in 0 to Len-1 loop
1657-
return_value(i) := to_natural_dec(jsonGetString(JSONContext, Path & "/" & to_string(i)));
1658-
end loop;
1659-
return return_value;
1656+
for i in 0 to Len-1 loop
1657+
return_value(i) := to_natural_dec(jsonGetString(JSONContext, Path & "/" & to_string(i)));
1658+
end loop;
1659+
return return_value;
16601660
end function;
16611661

16621662
function jsonIsBoolean(JSONContext : T_JSON; Path : STRING) return BOOLEAN is

0 commit comments

Comments
 (0)