public UstNode VisitPatternId([NotNull] DslParser.PatternIdContext context) { string patternId = context.GetText(); if (SourceLanguage.IsCaseInsensitive() && !patternId.StartsWith("(?i)")) { patternId = "(?i)" + patternId; } IdToken result = new PatternIdToken(patternId, context.GetTextSpan()); return(result); }
private IdToken ProcessId(ITerminalNode idTerminal) { string id = idTerminal.GetText(); IdToken result; if (SourceLanguage.IsCaseInsensitive()) { result = new PatternIdToken("(?i)^" + id + "$", idTerminal.GetTextSpan()); } else { result = new IdToken(id, idTerminal.GetTextSpan(), null); } return(result); }