commit | 93c5f8af855fa623def6aa68eb68b0d627510af5 | [log] [tgz] |
---|---|---|
author | Hana (Hyang-Ah) Kim <hyangah@gmail.com> | Mon Oct 18 20:45:13 2021 -0400 |
committer | Hyang-Ah Hana Kim <hyangah@gmail.com> | Fri Oct 29 12:31:31 2021 +0000 |
tree | 1f1833dd3a2a85936b211f8e591e4d344b3f1865 | |
parent | d263badac881103ba54280fcf5b718863c3d5d81 [diff] |
example/ivy/android: fix demo to handle comments & 'quit' correctly Demo feature is implemented by reading the demo.ivy file included as an asset, read lines, and feed each line to mobile.Eval if it is not a comment line. Comments can start from the middle of a line so previously, the code simply looked for '#' in each line and treated the substring starting from it as a comment. This assumption is not correct - see ")format '%#x'". Without proper parsing, it is hard to do it correctly. This CL passes the entire line to Ivy as it is - the backend correctly parses the line with comments. One drawback of this change is, unlike the line comments, we don't apply the style for comments (gray font). But correctness is more important. This also simplifies the code. This CL implements the 'quit' command that terminates a demo session (as mentioned in the demo.ivy script). Change-Id: Ib0801338e0dd34c52c6c6209fe47a1846e71f0c8 Reviewed-on: https://go-review.googlesource.com/c/mobile/+/356732 Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Trust: Hyang-Ah Hana Kim <hyangah@gmail.com> Reviewed-by: Hajime Hoshi <hajimehoshi@gmail.com>
The Go mobile repository holds packages and build tools for using Go on mobile platforms.
Package documentation as a starting point:
The Go Mobile project is experimental. Use this at your own risk. While we are working hard to improve it, neither Google nor the Go team can provide end-user support.
This is early work and installing the build system requires Go 1.5. Follow the instructions on golang.org/wiki/Mobile to install the gomobile command, build the basic and the bind example apps.
Contributions to Go are appreciated. See https://golang.org/doc/contribute.html.