mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-15 00:38:52 +00:00
docs: clean up whitespace and fix typo in tutorial.md (#8695)
* docs: remove trailing whitespace * docs: fix typo in tutorial.md
This commit is contained in:
@@ -93,7 +93,7 @@ significant changes have been made.
|
||||
goal of this implementation. Support for 16 bit integers was also added.
|
||||
5. The code generation in this offers an "ObjectBuilder", which generates code
|
||||
very similar to the SDK classes that consume FlatBuffers, as well as Builder
|
||||
classes, which produces code which more closely resembles the builders in
|
||||
classes, which produces code which more closely resembles the builders in
|
||||
other languages. The ObjectBuilder classes are easier to use, at the cost of
|
||||
additional references allocated.
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ documentation to build `flatc` and should be familiar with
|
||||
|
||||
## FlatBuffers JavaScript library code location
|
||||
|
||||
The generated code for the FlatBuffers JavaScript library can be found at
|
||||
The generated code for the FlatBuffers JavaScript library can be found at
|
||||
https://www.npmjs.com/package/flatbuffers. To use it from sources:
|
||||
|
||||
1. Run `npm run compile` from the main folder to generate JS files from TS.
|
||||
@@ -36,7 +36,7 @@ transpile your sources to desired JS flavor. The minimal steps to get up and
|
||||
running with JS are:
|
||||
|
||||
1. Generate TS files from `*.fbs` by using the `--ts` option.
|
||||
1. Transpile resulting TS files to desired JS flavor using `tsc` (see
|
||||
1. Transpile resulting TS files to desired JS flavor using `tsc` (see
|
||||
https://www.typescriptlang.org/download for installation instructions).
|
||||
|
||||
~~~{.js}
|
||||
|
||||
@@ -81,4 +81,4 @@ Kotlin generated code was designed to be as close as possible to the java counte
|
||||
The most obvious ones are:
|
||||
|
||||
* Fields as accessed as Kotlin [properties](https://kotlinlang.org/docs/reference/properties.html)
|
||||
* Static methods are accessed in [companion object](https://kotlinlang.org/docs/reference/classes.html#companion-objects)
|
||||
* Static methods are accessed in [companion object](https://kotlinlang.org/docs/reference/classes.html#companion-objects)
|
||||
|
||||
@@ -50,7 +50,7 @@ file into a `string`, which you pass to the `GetRootAsMonster` function:
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.lua}
|
||||
-- require the library
|
||||
local flatbuffers = require("flatbuffers")
|
||||
|
||||
|
||||
-- require the generated code
|
||||
local monster = require("MyGame.Sample.Monster")
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ In some cases it's necessary to modify values in an existing FlatBuffer in place
|
||||
fatalError("couldn't mutate")
|
||||
}
|
||||
// mutate a struct field using flatbuffers struct
|
||||
// DONT use monster.pos to mutate since swift copy on write
|
||||
// DONT use monster.pos to mutate since swift copy on write
|
||||
// will not mutate the value in the buffer
|
||||
let vec = monster.mutablePos.mutate(z: 4)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user