private bool _CharFitsBetweenASTNodes(int char_pos, Parser.ASTNode left, Parser.ASTNode right) { return(left.Position.FirstLine == 1 && left.Position.LastLine == 1 && right.Position.FirstLine == 1 && right.Position.LastLine == 1 && char_pos >= left.Position.LastChar && char_pos <= right.Position.FirstChar); }
private bool _CharFitsInASTNode(int char_pos, Parser.ASTNode node, bool tight = false) { return(node.Position.FirstLine == 1 && node.Position.LastLine == 1 && char_pos >= (node.Position.FirstChar - ( (node is Parser.Argument) ? 1 : 0 )) && char_pos <= (node.Position.LastChar - ( tight ? 1 : 0 ))); }
public AutocompleteInfo(int arg_index, Parser.Command command_node, Parser.ASTNode ast_node) { ArgIndex = arg_index; CommandNode = command_node; ASTNode = ast_node; if (ASTNode != null) { LastCharIndex = ASTNode.Position.LastChar; FirstCharIndex = ASTNode.Position.FirstChar; } else { LastCharIndex = CommandNode.Position.LastChar; FirstCharIndex = CommandNode.Position.FirstChar; } }