docs: add rule map not align

上级 33c7413d
# 3. rule map not align issue
Date: 2020-08-29
## Status
2020-08-29 proposed
## Context
In currently, the [VSCode-textmate](https://github.com/microsoft/vscode-textmate) generated ruleid2rule has some duplicated fields.
```json
{
"id": 15,
"_name": "punctuation.definition.variable.makefile",
"_nameIsCapturing": false,
"_contentName": null,
"_contentNameIsCapturing": false,
"retokenizeCapturedWithRuleId": 0,
"_type": "CaptureRule"
},
{
"id": 16,
"_name": "punctuation.definition.variable.makefile",
"_nameIsCapturing": false,
"_contentName": null,
"_contentNameIsCapturing": false,
"retokenizeCapturedWithRuleId": 0,
"_type": "CaptureRule"
}
```
But in our case with Rust, if we don't merge those field, we will had issues. So we decide to merge it will name.
The issues is `stackoverflow`, ::laughing::::laughing::::laughing::
```
thread 'grammar::grammar::tests::should_build_makefile_grammar' has overflowed its stack
fatal runtime error: stack overflow
error: test failed, to rerun pass '-p scie-grammar --lib'
```
## Decision
Decision here...
## Consequences
Consequences here...
......@@ -2,3 +2,4 @@
* [1. base-language-choice](0001-base-language-choice.md)
* [2. grammer-engine-choice](0002-grammer-engine-choice.md)
* [3. rule-map-not-align-issue](0003-rule-map-not-align-issue.md)
......@@ -31,7 +31,6 @@ pub struct ITokenizeLineResult2 {
pub trait IGrammar {
fn tokenize_line(line_text: String, prev_state: Option<StackElement>) -> ITokenizeLineResult;
/**
* Tokenize `lineText` using previous line state `prevState`.
* The result contains the tokens in binary format, resolved with the following information:
......@@ -134,7 +133,6 @@ impl Grammar {
check_while_conditions: bool,
) {
let line_length = line_text.len();
let mut stop = false;
let mut anchor_position = -1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册