// Copyright 2017-2022 The MathJax Consortium
// SPDX-License-Identifier: Apache-2.0
// This file is a Go translation and modification of MathJax 3.2.2.
// Source: ts/input/tex/TexParser.ts and the active delimiter SymbolMaps.

package tex

// Delimiter readers use exact source keys: / differs from \/, and | differs
// from \|. Ordinary command lookup has its own dispatch policy.
func lookupDelimiter( string) (string, bool) {
	for  := len(mjSourceMaps) - 1;  >= 0; -- {
		 := mjSourceMaps[]
		if .Kind != mjSourceDelimiterMap {
			continue
		}
		switch .Name {
		case "delimiter", "AMSmath-delimiter", "AMSsymbols-delimiter", "mathtools-delimiters":
		default:
			continue
		}
		for  := len(.Entries) - 1;  >= 0; -- {
			 := .Entries[]
			if .Name ==  {
				, ,  := sourceSymbolValue(.Value)
				return , 
			}
		}
	}
	return "", false
}