Skip to content

Commit

Permalink
fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mkideal committed Sep 30, 2024
1 parent 5bac41b commit 5e91db4
Show file tree
Hide file tree
Showing 15 changed files with 18 additions and 17 deletions.
4 changes: 2 additions & 2 deletions builtin/protobuf.npl
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ message {{next .Type}} {
{{/* next/protobuf/struct.field:type: Handles custom field type if specified */}}
{{- define "next/protobuf/struct.field:type" -}}
{{- $type := "" -}}
{{- if .Annotations.next.proto_type -}}
{{- $type = .Annotations.next.proto_type -}}
{{- if .Annotations.next.protobuf_type -}}
{{- $type = .Annotations.next.protobuf_type -}}
{{- else -}}
{{- $type = next .Type -}}
{{- end -}}
Expand Down
2 changes: 1 addition & 1 deletion src/compile/compiler.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func (c *Compiler) SetupCommandFlags(flagSet *flag.FlagSet, u flags.UsageFunc) {
"`VERBOSE` levels: "+b("0")+"=error, "+b("1")+"=debug, "+b("2")+"=trace.\n"+
"Usually, the trace message used for debugging the compiler itself.\n"+
"Levels "+b("1")+" (debug) and above enable execution of:\n"+
" -"+b("print")+" and "+b("printf")+" in Next source filesa (.next).\n"+
" -"+b("print")+" and "+b("printf")+" in Next source files (.next).\n"+
" -"+b("debug")+" in Next template files (.npl).\n",
))

Expand Down
2 changes: 1 addition & 1 deletion website/example/gen/c/demo/demo.next.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ typedef struct DEMO_LoginRequest {
char* username;
char* password;
/**
* @optional annotation is a custom annotation that marks a field as optional.
* @optional annotation is a builtin annotation that marks a field as optional.
*/
char* device;
DEMO_OperatingSystem os;
Expand Down
2 changes: 1 addition & 1 deletion website/example/gen/cpp/demo.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class LoginRequest {
public:
std::string username = {""};
std::string password = {""};
// @optional annotation is a custom annotation that marks a field as optional.
// @optional annotation is a builtin annotation that marks a field as optional.
std::string device = {""};
OperatingSystem os = {OperatingSystem("")};
int64_t timestamp = {0};
Expand Down
2 changes: 1 addition & 1 deletion website/example/gen/csharp/demo/demo.next.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public class LoginRequest
{
public string username { get; set; }
public string password { get; set; }
// @optional annotation is a custom annotation that marks a field as optional.
// @optional annotation is a builtin annotation that marks a field as optional.
public string device { get; set; }
public OperatingSystem os { get; set; }
public long timestamp { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion website/example/gen/go/demo/demo.next.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void setPassword(String password) {
}

/**
* @optional annotation is a custom annotation that marks a field as optional.
* @optional annotation is a builtin annotation that marks a field as optional.
*/
private String device;

Expand Down
2 changes: 1 addition & 1 deletion website/example/gen/js/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export class LoginRequest {
/** @type { String } */
this.password = "";
/**
* @optional annotation is a custom annotation that marks a field as optional.
* @optional annotation is a builtin annotation that marks a field as optional.
* @type { String }
*/
this.device = "";
Expand Down
2 changes: 1 addition & 1 deletion website/example/gen/lua/demo.lua
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ function LoginRequest:new()
local obj = {
username = "",
password = "",
-- @optional annotation is a custom annotation that marks a field as optional.
-- @optional annotation is a builtin annotation that marks a field as optional.
device = "",
os = nil,
timestamp = 0
Expand Down
2 changes: 1 addition & 1 deletion website/example/gen/php/demo.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class LoginRequest
public string $username;
public string $password;
/**
* @optional annotation is a custom annotation that marks a field as optional.
* @optional annotation is a builtin annotation that marks a field as optional.
*/
public string $device;
public OperatingSystem $os;
Expand Down
2 changes: 1 addition & 1 deletion website/example/gen/protobuf/demo.proto
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ message Contract {
message LoginRequest {
string username = 1;
string password = 2;
// @optional annotation is a custom annotation that marks a field as optional.
// @optional annotation is a builtin annotation that marks a field as optional.
optional string device = 3;
fixed64 timestamp = 5;
}
Expand Down
2 changes: 1 addition & 1 deletion website/example/gen/python/demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def __init__(self):
self.username = ""
self.password = ""
"""
@optional annotation is a custom annotation that marks a field as optional.
@optional annotation is a builtin annotation that marks a field as optional.
"""
self.device = ""
self.os = OperatingSystem("")
Expand Down
2 changes: 1 addition & 1 deletion website/example/gen/rust/src/demo/demo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ pub struct Contract {
pub struct LoginRequest {
pub username: String,
pub password: String,
/// @optional annotation is a custom annotation that marks a field as optional.
/// @optional annotation is a builtin annotation that marks a field as optional.
pub device: String,
pub os: OperatingSystem,
pub timestamp: i64,
Expand Down
2 changes: 1 addition & 1 deletion website/example/gen/ts/demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export class LoginRequest {
username: string = "";
password: string = "";
/**
* @optional annotation is a custom annotation that marks a field as optional.
* @optional annotation is a builtin annotation that marks a field as optional.
* @type { string }
*/
device: string = "";
Expand Down
5 changes: 3 additions & 2 deletions website/example/next/demo.next
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ enum OperatingSystem {
struct LoginRequest {
string username;
string password;
// @optional annotation is a custom annotation that marks a field as optional.

// @optional annotation is a builtin annotation that marks a field as optional.
@optional string device;
@next(available="!protobuf")
@optional(default=OperatingSystem.IOS) OperatingSystem os;
Expand All @@ -116,7 +117,7 @@ struct LoginRequest {
// @optional vector<string> tags;
// @optional map<string, int> scores;

@next(proto_type="fixed64")
@next(protobuf_type="fixed64")
int64 timestamp;
}

Expand Down

0 comments on commit 5e91db4

Please sign in to comment.