aboutsummaryrefslogtreecommitdiff
path: root/doc/docs/pt-br/doc/getting-started/usage.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/docs/pt-br/doc/getting-started/usage.md')
-rw-r--r--doc/docs/pt-br/doc/getting-started/usage.md105
1 files changed, 53 insertions, 52 deletions
diff --git a/doc/docs/pt-br/doc/getting-started/usage.md b/doc/docs/pt-br/doc/getting-started/usage.md
index 45161c6..7653838 100644
--- a/doc/docs/pt-br/doc/getting-started/usage.md
+++ b/doc/docs/pt-br/doc/getting-started/usage.md
@@ -1,20 +1,20 @@
1# Usage 1# Uso
2 2
3## Lua Module 3## Módulo Lua
4 4
5Use YueScript module in Lua: 5Use o módulo YueScript em Lua:
6 6
7* **Case 1** 7* **Caso 1**
8 8
9 Require "your_yuescript_entry.yue" in Lua. 9 Use require em "your_yuescript_entry.yue" no Lua.
10 ```Lua 10 ```Lua
11 require("yue")("your_yuescript_entry") 11 require("yue")("your_yuescript_entry")
12 ``` 12 ```
13 And this code still works when you compile "your_yuescript_entry.yue" to "your_yuescript_entry.lua" in the same path. In the rest YueScript files just use the normal **require** or **import**. The code line numbers in error messages will also be handled correctly. 13 E esse código continua funcionando quando você compila "your_yuescript_entry.yue" para "your_yuescript_entry.lua" no mesmo caminho. Nos demais arquivos YueScript, use normalmente o **require** ou **import**. Os números de linha nas mensagens de erro também serão tratados corretamente.
14 14
15* **Case 2** 15* **Caso 2**
16 16
17 Require YueScript module and rewite message by hand. 17 Requerer o módulo YueScript e reescrever a mensagem manualmente.
18 18
19 ```lua 19 ```lua
20 local yue = require("yue") 20 local yue = require("yue")
@@ -26,9 +26,9 @@ Use YueScript module in Lua:
26 end) 26 end)
27 ``` 27 ```
28 28
29* **Case 3** 29* **Caso 3**
30 30
31 Use the YueScript compiler function in Lua. 31 Usar a função compiladora do YueScript em Lua.
32 32
33 ```lua 33 ```lua
34 local yue = require("yue") 34 local yue = require("yue")
@@ -48,9 +48,9 @@ Use YueScript module in Lua:
48 }) 48 })
49 ``` 49 ```
50 50
51## YueScript Tool 51## Ferramenta YueScript
52 52
53Use YueScript tool with: 53Use a ferramenta YueScript com:
54 54
55```shell 55```shell
56> yue -h 56> yue -h
@@ -60,52 +60,53 @@ Usage: yue
60 yue -w [<directory>] [options] 60 yue -w [<directory>] [options]
61 yue - 61 yue -
62 62
63Notes: 63Notas:
64 - '-' / '--' must be the first and only argument. 64 - '-' / '--' deve ser o primeiro e único argumento.
65 - '-o/--output' can not be used with multiple input files. 65 - '-o/--output' não pode ser usado com múltiplos arquivos de entrada.
66 - '-w/--watch' can not be used with file input (directory only). 66 - '-w/--watch' não pode ser usado com entrada de arquivo (apenas diretório).
67 - with '-e/--execute', remaining tokens are treated as script args. 67 - com '-e/--execute', os tokens restantes são tratados como argumentos do script.
68 68
69Options: 69Opções:
70 -h, --help Show this help message and exit. 70 -h, --help Mostrar esta mensagem de ajuda e sair.
71 -e <str>, --execute <str> Execute a file or raw codes 71 -e <str>, --execute <str> Executar um arquivo ou código bruto
72 -m, --minify Generate minified codes 72 -m, --minify Gerar código minificado
73 -r, --rewrite Rewrite output to match original line numbers 73 -r, --rewrite Reescrever saída para corresponder aos meros de linha originais
74 -t <output_to>, --output-to <output_to> 74 -t <output_to>, --output-to <output_to>
75 Specify where to place compiled files 75 Especificar onde colocar os arquivos compilados
76 -o <file>, --output <file> Write output to file 76 -o <file>, --output <file> Escrever saída em arquivo
77 -p, --print Write output to standard out 77 -p, --print Escrever saída na saída padrão
78 -b, --benchmark Dump compile time (doesn't write output) 78 -b, --benchmark Mostrar tempo de compilação (não grava saída)
79 -g, --globals Dump global variables used in NAME LINE COLUMN 79 -g, --globals Listar variáveis globais usadas em NOME LINHA COLUNA
80 -s, --spaces Use spaces in generated codes instead of tabs 80 -s, --spaces Usar espaços no código gerado em vez de tabulações
81 -l, --line-numbers Write line numbers from source codes 81 -l, --line-numbers Escrever números de linha do código fonte
82 -j, --no-implicit-return Disable implicit return at end of file 82 -j, --no-implicit-return Desabilitar retorno implícito no final do arquivo
83 -c, --reserve-comments Reserve comments before statement from source codes 83 -c, --reserve-comments Preservar comentários antes de instruções dodigo fonte
84 -w [<dir>], --watch [<dir>] 84 -w [<dir>], --watch [<dir>]
85 Watch changes and compile every file under directory 85 Observar alterações e compilar cada arquivo no diretório
86 -v, --version Print version 86 -v, --version Imprimir versão
87 - Read from standard in, print to standard out 87 - Ler da entrada padrão, imprimir na saída padrão
88 (Must be first and only argument) 88 (Deve ser o primeiro e único argumento)
89 -- Same as '-' (kept for backward compatibility) 89 -- Igual a '-' (mantido para compatibilidade retroativa)
90 90
91 --target <version> Specify the Lua version that codes will be generated to 91 --target <version> Especificar a versão do Lua para a qual o código se gerado
92 (version can only be 5.1 to 5.5) 92 (a versão pode ser apenas 5.1 a 5.5)
93 --path <path_str> Append an extra Lua search path string to package.path 93 --path <path_str> Adicionar um caminho de busca Lua extra ao package.path
94 --<key>=<value> Pass compiler option in key=value form (existing behavior) 94 --<key>=<value> Passar opção do compilador no formato key=value (comportamento existente)
95 95
96 Execute without options to enter REPL, type symbol '$' 96 Execute sem opções para entrar no REPL, digite o símbolo '$'
97 in a single line to start/stop multi-line mode 97 em uma única linha para iniciar/parar o modo multilinha
98``` 98```
99Use cases:
100 99
101Recursively compile every YueScript file with extension **.yue** under current path: **yue .** 100Casos de uso:
102 101
103Compile and save results to a target path: **yue -t /target/path/ .** 102Compilar recursivamente todos os arquivos YueScript com extensão **.yue** no caminho atual: **yue .**
104 103
105Compile and reserve debug info: **yue -l .** 104Compilar e salvar resultados em um caminho de destino: **yue -t /target/path/ .**
106 105
107Compile and generate minified codes: **yue -m .** 106Compilar e preservar informações de debug: **yue -l .**
108 107
109Execute raw codes: **yue -e 'print 123'** 108Compilar e gerar código minificado: **yue -m .**
110 109
111Execute a YueScript file: **yue -e main.yue** 110Executar código bruto: **yue -e 'print 123'**
111
112Executar um arquivo YueScript: **yue -e main.yue**