aboutsummaryrefslogtreecommitdiff
path: root/samples/sample_text.lobster
diff options
context:
space:
mode:
Diffstat (limited to 'samples/sample_text.lobster')
-rw-r--r--samples/sample_text.lobster12
1 files changed, 6 insertions, 6 deletions
diff --git a/samples/sample_text.lobster b/samples/sample_text.lobster
index 9da4fa25..26b3eaff 100644
--- a/samples/sample_text.lobster
+++ b/samples/sample_text.lobster
@@ -12,20 +12,20 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-include from "../lobster/"
-include "monster_generated.lobster"
+import from "../lobster/"
+import monster_generated
// Example how to interop with JSON.
// Test loading some JSON, converting it to a binary FlatBuffer and back again.
// First read the schema and JSON data.
-schema := read_file("monster.fbs", true)
-json := read_file("monsterdata.json", true)
+let schema = read_file("monster.fbs", true)
+let json = read_file("monsterdata.json", true)
assert schema and json
// Parse JSON to binary:
-fb, err1 := flatbuffers_json_to_binary(schema, json, [])
+let fb, err1 = flatbuffers_json_to_binary(schema, json, [])
assert not err1
// Access one field in it, just to check:
@@ -33,7 +33,7 @@ let monster = MyGame_Sample_GetRootAsMonster(fb)
assert monster.name == "Orc"
// Convert binary back to JSON:
-json2, err2 := flatbuffers_binary_to_json(schema, fb, [])
+let json2, err2 = flatbuffers_binary_to_json(schema, fb, [])
assert not err2
// The generated JSON should be exactly equal to the original!