diff --git a/src/_string_tools/slice_field.nr b/src/_string_tools/slice_field.nr index 44e8f96..6b8c7e9 100644 --- a/src/_string_tools/slice_field.nr +++ b/src/_string_tools/slice_field.nr @@ -3,7 +3,7 @@ global PHI: Field = 0x30644E72E131A029B85045B68181585D; global PLO_200_felt: Field = 0x29B85045B68181585D2833E84879B9709143E1F593F0000001; global PHI_54_felt: Field = 0x30644E72E131A0; -global TWO_POW_200 = 0x100000000000000000000000000000000000000000000000000; +global TWO_POW_200: Field = 0x100000000000000000000000000000000000000000000000000; struct Slice200 { hihi: u64, // 7 bytes hilo: u64, // 7 bytes diff --git a/src/_string_tools/slice_packed_field.nr b/src/_string_tools/slice_packed_field.nr index 5d4a1a2..5751e45 100644 --- a/src/_string_tools/slice_packed_field.nr +++ b/src/_string_tools/slice_packed_field.nr @@ -5,10 +5,10 @@ // ############################################################# // ### GLOBAL VARIABLES AND LOOKUP TABLES // ############################################################# -global two_pow_128 = 0x100000000000000000000000000000000; -global two_pow_64 = 0x10000000000000000; -global two_pow_32 = 0x100000000; -global two_pow_16 = 0x10000; +global two_pow_128: Field = 0x100000000000000000000000000000000; +global two_pow_64: Field = 0x10000000000000000; +global two_pow_32: Field = 0x100000000; +global two_pow_16: Field = 0x10000; global path_multipliers_chunk4: [Field; 32] = [ /* 0 (00000) */ 0, diff --git a/src/_table_generation/make_tables.nr b/src/_table_generation/make_tables.nr index 9d19e4f..553884e 100644 --- a/src/_table_generation/make_tables.nr +++ b/src/_table_generation/make_tables.nr @@ -1,11 +1,11 @@ //! Contains methods used to generate tables in `json_tables.nr`. These table generation methods shouldn't be used inside of actual circuits. mod CaptureMode { - global GRAMMAR_CAPTURE = 0; - global STRING_CAPTURE = 1; - global NUMERIC_CAPTURE = 2; - global LITERAL_CAPTURE = 3; - global ERROR_CAPTURE = 4; + global GRAMMAR_CAPTURE: Field = 0; + global STRING_CAPTURE: Field = 1; + global NUMERIC_CAPTURE: Field = 2; + global LITERAL_CAPTURE: Field = 3; + global ERROR_CAPTURE: Field = 4; } use crate::_table_generation::make_tables::CaptureMode::STRING_CAPTURE; use crate::_table_generation::make_tables_subtables::{ diff --git a/src/enums.nr b/src/enums.nr index 7d5c2aa..29b4ab1 100644 --- a/src/enums.nr +++ b/src/enums.nr @@ -1,29 +1,29 @@ mod ScanMode { - global GRAMMAR_SCAN = 0; - global STRING_SCAN = 1; - global NUMERIC_SCAN = 2; + global GRAMMAR_SCAN: Field = 0; + global STRING_SCAN: Field = 1; + global NUMERIC_SCAN: Field = 2; global LITERAL_SCAN: Field = 3; } mod Token { - global NO_TOKEN = 0; - global BEGIN_OBJECT_TOKEN = 1; - global END_OBJECT_TOKEN = 2; - global BEGIN_ARRAY_TOKEN = 3; + global NO_TOKEN: Field = 0; + global BEGIN_OBJECT_TOKEN: Field = 1; + global END_OBJECT_TOKEN: Field = 2; + global BEGIN_ARRAY_TOKEN: Field = 3; global END_ARRAY_TOKEN: Field = 4; - global KEY_SEPARATOR_TOKEN = 5; - global VALUE_SEPARATOR_TOKEN = 6; - global STRING_TOKEN = 7; - global NUMERIC_TOKEN = 8; - global LITERAL_TOKEN = 9; - global KEY_TOKEN = 10; - global NUM_TOKENS = 11; - global NUM_TOKENS_MUL_2 = 22; + global KEY_SEPARATOR_TOKEN: Field = 5; + global VALUE_SEPARATOR_TOKEN: Field = 6; + global STRING_TOKEN: Field = 7; + global NUMERIC_TOKEN: Field = 8; + global LITERAL_TOKEN: Field = 9; + global KEY_TOKEN: Field = 10; + global NUM_TOKENS: u32 = 11; + global NUM_TOKENS_MUL_2: u32 = 22; } mod Layer { - global OBJECT_LAYER = 0; - global ARRAY_LAYER = 1; - global SINGLE_VALUE_LAYER = 2; + global OBJECT_LAYER: Field = 0; + global ARRAY_LAYER: Field = 1; + global SINGLE_VALUE_LAYER: Field = 2; } diff --git a/src/get_literal.nr b/src/get_literal.nr index eec7cda..dd173f1 100644 --- a/src/get_literal.nr +++ b/src/get_literal.nr @@ -5,7 +5,7 @@ use crate::getters::JSONValue; use crate::json::JSON; use crate::json_entry::JSONEntry; -global MAX_LITERAL_LENGTH_AS_STRING = 5; +global MAX_LITERAL_LENGTH_AS_STRING : u32= 5; global LITERAL_OFFSET_SHIFT: [Field; 6] = [0x10000000000, 0x100000000, 0x1000000, 0x10000, 0x100, 1]; diff --git a/src/get_number.nr b/src/get_number.nr index ea10bd2..be5a6f0 100644 --- a/src/get_number.nr +++ b/src/get_number.nr @@ -6,7 +6,7 @@ use crate::json::JSON; use crate::json_entry::JSONEntry; use crate::json_tables::ASCII_TO_NUMBER; -global U64_LENGTH_AS_BASE10_STRING = 20; +global U64_LENGTH_AS_BASE10_STRING: u32 = 20; global NUMBER_OFFSET_SHIFT: [Field; 21] = [ 100000000000000000000, 10000000000000000000,