Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]> TryBot-Result: Go Bot <[email protected]> Trust: Hyang-Ah Hana Kim <[email protected]> Reviewed-by: Hajime Hoshi <[email protected]>
- Loading branch information