aboutsummaryrefslogtreecommitdiff
path: root/cmd/starlark
AgeCommit message (Collapse)Author
2021-01-21resolver: make -nesteddef and -lambda always on (#328)alandonovan
See https://github.com/bazelbuild/starlark/pull/145 for spec changes. Updates https://github.com/bazelbuild/starlark/issues/20
2020-11-11starlark: bring floating-point into spec compliance (#313)alandonovan
This change makes go.starlark.net's floating-point implementation match the proposed spec (see https://github.com/bazelbuild/starlark/pull/119), and thus much more closely match the behavior of the Java implementation. The major changes are: - Float values are totally ordered; NaN compares greater than +Inf. - The string form of a finite float value always contains an exponent or a decimal point, so they are self-evidently not int values. - Operations that would cause a large integer to become rounded to an infinite float are now an error. The resolve.AllowFloat boolean, and the corresponding -float command-line flag, now have no effect. Floating point support is always enabled.
2020-06-11starlarkjson: a standard JSON module for Starlark (#179)alandonovan
This change defines a standard Starlark module for JSON encoding and decoding. See json.go for documentation. It is intended to subsume, generalize, and eventually replace Bazel's ill-conceived struct.to_json method. The json module is predeclared in the Starlark REPL environment. See related issues: https://github.com/bazelbuild/bazel/issues/7896 https://buganizer.corp.google.com/issues/23962735 https://buganizer.corp.google.com/issues/70210417 https://github.com/bazelbuild/bazel/issues/7879#issuecomment-477713954 https://github.com/bazelbuild/bazel/issues/5542 https://github.com/bazelbuild/bazel/issues/10176 https://github.com/bazelbuild/starlark/pull/83 https://github.com/bazelbuild/bazel/issues/3732
2019-07-12cmd/starlark: -disassemble flag causes compiler to print disassembly (#207)alandonovan
Also, print file:line:column in disassembly output.
2019-04-11cmd/starlark: add Go memory profiling support (#190)Josh Bleecher Snyder
* cmd/starlark: add Go memory profiling support For #184 * cmd/starlark: check errors in profiling code
2019-04-03starlark: a simple pprof-compatible execution-time profiler (#181)alandonovan
See profile.go for design.
2019-01-30resolve: enable bitwise (& | ~ ^ << >>) operators always (#123)Alan Donovan
See https://github.com/bazelbuild/starlark/issues/20#issuecomment-456647994
2019-01-23cmd/starlark: fix sense of -showenv, flipped my mistakeAlan Donovan
Change-Id: I87611167fd3a03a87b1cd98127ca5de2fd38b73c
2019-01-03starlark: add StringDict.Keys method (#86)alandonovan
...and remove three ad-hoc implementations. Also, don't preallocate slice argument to writeValue, as it does not escape to the heap.
2019-01-02Merge pull request #77 from google/optionsJay Conrod
starlark: permit if/for/while at toplevel if -globalreassign
2018-12-18starlark: permit if/for/while at toplevel if -globalreassignAlan Donovan
Also: - make the option handling work the same across all tests - be explicit about which options are needed in each test chunk - improve documentation of options - rename fp option to float consistently - rename global_reassign option to globalreassign consistently Fixes #36 Change-Id: I8fdf5725ce47c2f4a87aac9d5c24583e503d0f74
2018-12-17starlark: API additions for improved debugging (#76)alandonovan
This change adds a number of small features to improve debugging. The actual debugger API will come in a later change. - Thread.Name : an optional string field that describes the purpose of the thread, for use in debugging. - (*Program).Filename: a method that reports the file of the program. Also, a String method that returns the same thing. Also, a test that it reports the correct location even for an empty file (a special case of the previous implementation). - (*Frame).Local(i int): a method to return the value of a local variable of an active frame, such as one might use in debugger's stack trace. - ExprFunc: creates a starlark.Function from a given expression, such as one might use in a debugger REPL.
2018-12-07cmd/starlark: add -c flag to execute cmdline program (#47)Josh Bleecher Snyder
-c was chosen to match Python. Sample: $ starlark -c "print(max(range(10)))" 9 $ starlark -c "a = 'hi'" -showenv a = "hi"
2018-12-07Add while statement and allow recursion (#39)Alessandro Arzilli
Adds a flag, AllowRecursion, that enables while statements and recursive functions.
2018-11-01simplify welcome messageAlan Donovan
Change-Id: I84d6a9d8426ff869997e8dce17bda9a30bccef71
2018-11-01add docs/PKG/index.html redirects and import commentsAlan Donovan
2018-10-31rename packages under go.starlark.netAlan Donovan
2018-10-23rename skylark -> starlarkAlan Donovan
Change-Id: Iebd0e040ff674b2f9da39bf5242c8afaa7f4ddc8