spelling: optimization

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
pull/287/head
Josh Soref 4 months ago
parent c2b119d34a
commit 78f3943025
  1. 6
      README.md
  2. 10
      docs/index.js
  3. 2
      grammar/cpp-peglib.peg
  4. 4
      lint/README.md
  5. 2
      peglib.h

@ -33,7 +33,7 @@ The PEG syntax is well described on page 2 in the [document](http://www.brynosau
* `%recovery(` ... `)` (Error recovery operator)
* `exp⇑label` or `exp^label` (Syntax sugar for `(exp / %recover(label))`)
* `label { error_message "..." }` (Error message instruction)
* `{ no_ast_opt }` (No AST node optimazation instruction)
* `{ no_ast_opt }` (No AST node optimization instruction)
'End of Input' check will be done as default. In order to disable the check, please call `disable_eoi_check`.
@ -702,7 +702,7 @@ Number <- < [0-9]+ >
- Number (3)
```
### AST optimazation
### AST optimization
```
> peglint --ast --opt --source "1 + 2 * 3" a.peg
@ -713,7 +713,7 @@ Number <- < [0-9]+ >
- Multiplicative[Number] (3)
```
### Adjust AST optimazation with `no_ast_opt` instruction
### Adjust AST optimization with `no_ast_opt` instruction
```
> cat a.peg

@ -26,7 +26,7 @@ const codeAst = setupInfoArea("code-ast");
const codeAstOptimized = setupInfoArea("code-ast-optimized");
const codeProfile = setupInfoArea("code-profile");
$('#opt-mode').val(localStorage.getItem('optimazationMode') || 'all');
$('#opt-mode').val(localStorage.getItem('optimizationMode') || 'all');
$('#packrat').prop('checked', localStorage.getItem('packrat') === 'true');
$('#auto-refresh').prop('checked', localStorage.getItem('autoRefresh') === 'true');
$('#parse').prop('disabled', $('#auto-refresh').prop('checked'));
@ -60,7 +60,7 @@ function generateErrorListHTML(errors) {
function updateLocalStorage() {
localStorage.setItem('grammarText', grammar.getValue());
localStorage.setItem('codeText', code.getValue());
localStorage.setItem('optimazationMode', $('#opt-mode').val());
localStorage.setItem('optimizationMode', $('#opt-mode').val());
localStorage.setItem('packrat', $('#packrat').prop('checked'));
localStorage.setItem('autoRefresh', $('#auto-refresh').prop('checked'));
}
@ -74,7 +74,7 @@ function parse() {
const $codeInfo = $('#code-info');
const codeText = code.getValue();
const optimazationMode = $('#opt-mode').val();
const optimizationMode = $('#opt-mode').val();
const packrat = $('#packrat').prop('checked');
$grammarInfo.html('');
@ -89,7 +89,7 @@ function parse() {
return;
}
const mode = optimazationMode == 'all';
const mode = optimizationMode == 'all';
$('#overlay').css({
'z-index': '1',
@ -163,7 +163,7 @@ function makeOnClickInInfo(editor) {
$('#grammar-info').on('click', 'li', makeOnClickInInfo(grammar));
$('#code-info').on('click', 'li', makeOnClickInInfo(code));
// Event handing in the AST optimazation
// Event handing in the AST optimization
$('#opt-mode').on('change', setupTimer);
$('#packrat').on('change', setupTimer);
$('#auto-refresh').on('change', () => {

@ -145,5 +145,5 @@ PrecedenceAssoc <- [LR]
# Error message instruction
ErrorMessage <- "message" SpacesOom LiteralD SpacesZom
# No Ast node optimazation instruction
# No Ast node optimization instruction
NoAstOpt <- "no_ast_opt" SpacesZom

@ -90,7 +90,7 @@ Number <- < [0-9]+ >
- Number (3)
```
### AST optimazation
### AST optimization
```
> peglint --ast --opt --source "1 + 2 * 3" a.peg
@ -101,7 +101,7 @@ Number <- < [0-9]+ >
- Multiplicative[Number] (3)
```
### Adjust AST optimazation with `no_ast_opt` instruction
### Adjust AST optimization with `no_ast_opt` instruction
```
> cat a.peg

@ -3490,7 +3490,7 @@ private:
g["ErrorMessage"] <= seq(lit("error_message"), g["SpacesOom"],
g["LiteralD"], g["SpacesZom"]);
// No Ast node optimazation instruction
// No Ast node optimization instruction
g["NoAstOpt"] <= seq(lit("no_ast_opt"), g["SpacesZom"]);
// Set definition names

Loading…
Cancel
Save