From 2433c27f26bc1be2d9b33f6550482abc48fa31ef Mon Sep 17 00:00:00 2001 From: Ryo Nihei Date: Sun, 1 Aug 2021 17:17:53 +0900 Subject: Change APIs Change fields of tokens, results of lexical analysis, as follows: - Rename: mode -> mode_id - Rename: kind_id -> mode_kind_id - Add: kind_id The kind ID is unique across all modes, but the mode kind ID is unique only within a mode. Change fields of a transition table as follows: - Rename: initial_mode -> initial_mode_id - Rename: modes -> mode_names - Rename: kinds -> kind_names - Rename: specs[].kinds -> specs[].kind_names - Rename: specs[].dfa.initial_state -> specs[].dfa.initial_state_id Change public types defined in the spec package as follows: - Rename: LexModeNum -> LexModeID - Rename: LexKind -> LexKindName - Add: LexKindID - Add: StateID --- compiler/test_util_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'compiler/test_util_test.go') diff --git a/compiler/test_util_test.go b/compiler/test_util_test.go index 2ead2c9..72e150b 100644 --- a/compiler/test_util_test.go +++ b/compiler/test_util_test.go @@ -1,5 +1,7 @@ package compiler +import "github.com/nihei9/maleeni/spec" + func newRangeSymbolNodeWithPos(from, to byte, pos symbolPosition) *symbolNode { n := newRangeSymbolNode(from, to) n.pos = pos @@ -13,7 +15,7 @@ func newSymbolNodeWithPos(v byte, pos symbolPosition) *symbolNode { } func newEndMarkerNodeWithPos(id int, pos symbolPosition) *endMarkerNode { - n := newEndMarkerNode(id) + n := newEndMarkerNode(spec.LexModeKindID(id)) n.pos = pos return n } -- cgit v1.2.3