_id
stringlengths
2
7
text
stringlengths
6
2.61k
title
stringclasses
1 value
c6600
// CompareDepth compares two Skylark values. // The comparison operation must be one of EQL, NEQ, LT, LE, GT, or GE. // CompareDepth returns an error if an ordered comparison was // requested for a pair of values that do not support it. // // The depth parameter limits the maximum depth of recursion // in cyclic data structures.
c6601
// dump is provided as an aid to debugging.
c6602
// hashString computes the hash of s.
c6603
// softHashString computes the FNV hash of s in software.
c6604
// ParseExpr parses a Skylark expression. // See Parse for explanation of parameters.
c6605
// nextToken advances the scanner and returns the position of the // previous token.
c6606
// parseLambda parses a lambda expression. // The allowCond flag allows the body to be an 'a if b else c' conditional.
c6607
// primary_with_suffix = primary // | primary '.' IDENT // | primary slice_suffix // | primary call_suffix
c6608
// Comment assignment. // We build two lists of all subnodes, preorder and postorder. // The preorder list is ordered by start location, with outer nodes first. // The postorder list is ordered by end location, with outer nodes last. // We use the preorder list to assign each whole-line comment to the syntax // immediately following it, and we use the postorder list to assign each // end-of-line comment to the syntax immediately preceding it. // flattenAST returns the list of AST nodes, both in prefix order and in postfix // order.
c6609
// isCasedString reports whether its argument contains any cased characters.
c6610
// MakeInt64 returns a Skylark int for the specified int64.
c6611
// MakeUint64 returns a Skylark int for the specified uint64.
c6612
// Int64 returns the value as an int64. // If it is not exactly representable the result is undefined and ok is false.
c6613
// Uint64 returns the value as a uint64. // If it is not exactly representable the result is undefined and ok is false.
c6614
// Float returns the float value nearest i.
c6615
// AsInt32 returns the value of x if is representable as an int32.
c6616
// NumberToInt converts a number x to an integer value. // An int is returned unchanged, a float is truncated towards zero. // NumberToInt reports an error for all other values.
c6617
// finiteFloatToInt converts f to an Int, truncating towards zero. // f must be finite.
c6618
// non-standard dialect flags
c6619
// SetLocal sets the thread-local value associated with the specified key. // It must not be called after execution begins.
c6620
// The Frames of a thread are structured as a spaghetti stack, not a // slice, so that an EvalError can copy a stack efficiently and immutably. // In hindsight using a slice would have led to a more convenient API.
c6621
// Position returns the source position of the current point of execution in this frame.
c6622
// Backtrace returns a user-friendly error message describing the stack // of calls that led to this error.
c6623
// WriteBacktrace writes a user-friendly description of the stack to buf.
c6624
// Stack returns the stack of frames, innermost first.
c6625
// SourceProgram produces a new program by parsing, resolving, // and compiling a Skylark source file. // On success, it returns the parsed file and the compiled program. // The filename and src parameters are as for syntax.Parse. // // The isPredeclared predicate reports whether a name is // a pre-declared identifier of the current module. // Its typical value is predeclared.Has, // where predeclared is a StringDict of pre-declared values.
c6626
// CompiledProgram produces a new program from the representation // of a compiled program previously saved by Program.Write.
c6627
// Init creates a set of global variables for the program, // executes the toplevel code of the specified program, // and returns a new, unfrozen dictionary of the globals.
c6628
// The following functions are primitive operations of the byte code interpreter. // list += iterable
c6629
// getAttr implements x.dot.
c6630
// setField implements x.name = y.
c6631
// Call calls the function fn with the specified positional and keyword arguments.
c6632
// Expr resolves the specified expression. // It returns the local variables bound within the expression. // // The isPredeclared and isUniversal predicates behave as for the File function.
c6633
// bind creates a binding for id in the current block, // if there is not one already, and reports an error if // a global was re-bound and allowRebind is false. // It returns whether a binding already existed.
c6634
// lookupLocal looks up an identifier within its immediately enclosing function.
c6635
// lookupLexical looks up an identifier within its lexically enclosing environment.
c6636
// FromStringDict returns a whose elements are those of d. // The constructor parameter specifies the constructor; use Default for an ordinary struct.
c6637
// Attr returns the value of the specified field, // or deprecated method if the name is "to_json" or "to_proto" // and the struct has no field of that name.
c6638
// Read parses a chunked file and returns its chunks. // It reports failures using the reporter.
c6639
// GotError should be called by the client to report an error at a particular line. // GotError reports unexpected errors to the chunk's reporter.
c6640
// Done should be called by the client to indicate that the chunk has no more errors. // Done reports expected errors that did not occur to the chunk's reporter.
c6641
// add returns the position at the end of s, assuming it starts at p.
c6642
// peekRune returns the next rune in the input without consuming it. // Newlines in Unix, DOS, or Mac format are treated as one rune, '\n'.
c6643
// readRune consumes and returns the next rune in the input. // Newlines in Unix, DOS, or Mac format are treated as one rune, '\n'.
c6644
// startToken marks the beginning of the next input token. // It must be followed by a call to endToken once the token has // been consumed using readRune.
c6645
// endToken marks the end of an input token. // It records the actual token string in val.raw if the caller // has not done that already.
c6646
// PrintError prints the error to stderr, // or its backtrace if it is a Skylark evaluation error.
c6647
// MakeLoad returns a simple sequential implementation of module loading // suitable for use in the REPL. // Each function returned by MakeLoad accesses a distinct private cache.
c6648
// Write writes a compiled Skylark program to out.
c6649
// ReadProgram reads a compiled Skylark program from in.
c6650
// idents convert syntactic identifiers to compiled form.
c6651
// Expr compiles an expression to a program consisting of a single toplevel function.
c6652
// File compiles the statements of a file into a program.
c6653
// generate emits the linear instruction stream from the CFG, // and builds the PC-to-line number table.
c6654
// PrintOp prints an instruction. // It is provided for debugging.
c6655
// emit emits an instruction to the current block.
c6656
// emit1 emits an instruction with an immediate operand.
c6657
// jump emits a jump to the specified block. // On return, the current block is unset.
c6658
// nameIndex returns the index of the specified name // within the name pool, adding it if necessary.
c6659
// constantIndex returns the index of the specified constant // within the constant pool, adding it if necessary.
c6660
// functionIndex returns the index of the specified function // AST the nestedfun pool, adding it if necessary.
c6661
// string emits code to push the specified string.
c6662
// set emits code to store the top-of-stack value // to the specified local or global variable.
c6663
// lookup emits code to push the value of the specified variable.
c6664
// assign implements lhs = rhs for arbitrary expressions lhs. // RHS is on top of stack, consumed.
c6665
// add returns an expression denoting the sum of args, // which are all addable values of the type indicated by code. // The resulting syntax is degenerate, lacking position, etc.
c6666
// ifelse emits a Boolean control flow decision. // On return, the current block is unset.
c6667
// Returns a nice formatted error string.
c6668
// RawLine returns the affected line from the original template, if available.
c6669
// Creates a new parser to parse tokens. // Used inside pongo2 to parse documents and to provide an easy-to-use // parser for tag authors
c6670
// Returns the CURRENT token if the given type matches. // Consumes this token on success.
c6671
// Returns the CURRENT token if the given type AND value matches. // Consumes this token on success.
c6672
// Returns the CURRENT token if the given type AND value matches. // It DOES NOT consume the token.
c6673
// Error produces a nice error message and returns an error-object. // The 'token'-argument is optional. If provided, it will take // the token's position information. If not provided, it will // automatically use the CURRENT token's position information.
c6674
// Same as ExecuteWriter. The only difference between both functions is that // this function might already have written parts of the generated template in the // case of an execution error because there's no intermediate buffer involved for // performance reasons. This is handy if you need high performance template // generation or if you want to manage your own pool of buffers.
c6675
// Executes the template and returns the rendered template as a string
c6676
// MustNewLocalFileSystemLoader creates a new LocalFilesystemLoader instance // and panics if there's any error during instantiation. The parameters // are the same like NewLocalFileSystemLoader.
c6677
// Get reads the path's content from your local filesystem.
c6678
// NewSandboxedFilesystemLoader creates a new sandboxed local file system instance.
c6679
// BanTag bans a specific tag for this template set. See more in the documentation for TemplateSet.
c6680
// BanFilter bans a specific filter for this template set. See more in the documentation for TemplateSet.
c6681
// CleanCache cleans the template cache. If filenames is not empty, // it will remove the template caches of those filenames. // Or it will empty the whole template cache. It is thread-safe.
c6682
// FromString loads a template from string and returns a Template instance.
c6683
// FromBytes loads a template from bytes and returns a Template instance.
c6684
// FromFile loads a template from a filename and returns a Template instance.
c6685
// RenderTemplateString is a shortcut and renders a template string directly.
c6686
// RenderTemplateBytes is a shortcut and renders template bytes directly.
c6687
// RenderTemplateFile is a shortcut and renders a template file directly.
c6688
// AsSafeValue works like AsValue, but does not apply the 'escape' filter.
c6689
// IsFloat checks whether the underlying value is a float
c6690
// IsInteger checks whether the underlying value is an integer
c6691
// Len returns the length for an array, chan, map, slice or string. // Otherwise it will return 0.
c6692
// Index gets the i-th item of an array, slice or string. Otherwise // it will return NIL.
c6693
// Interface gives you access to the underlying value.
c6694
// EqualValueTo checks whether two values are containing the same value or object.
c6695
// MustApplyFilter behaves like ApplyFilter, but panics on an error.
c6696
// NewMockCollectorReader creates a new mock instance // nolint
c6697
// GetAllRecords indicates an expected call of GetAllRecords // nolint
c6698
// GetUserRecords mocks base method // nolint
c6699
// NewMockCollector creates a new mock instance // nolint