Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Phodal
scie
提交
8d3d647b
S
scie
项目概览
Phodal
/
scie
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
scie
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
8d3d647b
编写于
9月 07, 2020
作者:
P
Phodal Huang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: update demo code && fxied issue
上级
338dca8c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
14 addition
and
7 deletion
+14
-7
scie-grammar/src/grammar/grammar.rs
scie-grammar/src/grammar/grammar.rs
+3
-3
scie-grammar/src/rule/rule_factory.rs
scie-grammar/src/rule/rule_factory.rs
+1
-1
vscode-tests/index.js
vscode-tests/index.js
+10
-2
vscode-tests/vendor/main.js
vscode-tests/vendor/main.js
+0
-1
未找到文件。
scie-grammar/src/grammar/grammar.rs
浏览文件 @
8d3d647b
...
...
@@ -354,8 +354,8 @@ impl Grammar {
grammar
:
&
mut
Grammar
,
line_text
:
String
,
is_first_line
:
bool
,
mut
stack
:
&
mut
StackElement
,
mut
line_tokens
:
&
mut
LineTokens
,
stack
:
&
mut
StackElement
,
line_tokens
:
&
mut
LineTokens
,
captures
:
Vec
<
Box
<
dyn
AbstractRule
>>
,
capture_indices
:
Vec
<
IOnigCaptureIndex
>
,
)
->
Option
<
LineTokens
>
{
...
...
@@ -412,7 +412,7 @@ impl Grammar {
.get_content_name
(
Some
(
line_text
.clone
()),
Some
(
capture_indices
.clone
()));
let
content_name_scopes_list
=
name_scopes_list
.push
(
grammar
,
content_name
);
let
mut
stack_clone
=
stack
.clone
()
.push
(
let
stack_clone
=
stack
.clone
()
.push
(
capture
.retokenize_captured_with_rule_id
,
capture_index
.start
.clone
()
as
i32
,
-
1
,
...
...
scie-grammar/src/rule/rule_factory.rs
浏览文件 @
8d3d647b
...
...
@@ -103,7 +103,7 @@ impl RuleFactory {
if
let
Some
(
include_s
)
=
pattern
.clone
()
.include
{
if
include_s
.starts_with
(
"#"
)
{
let
first
=
remove_first
(
include_s
.as_str
());
let
mut
local_included_rule
=
repository
.map.name_map
.get_mut
(
first
);
let
local_included_rule
=
repository
.map.name_map
.get_mut
(
first
);
if
let
Some
(
rule
)
=
local_included_rule
.cloned
()
{
pattern_id
=
RuleFactory
::
get_compiled_rule_id
(
*
rule
,
...
...
vscode-tests/index.js
浏览文件 @
8d3d647b
...
...
@@ -20,13 +20,21 @@ const registry = new vsctm.Registry({
});
registry
.
loadGrammar
(
'
source.makefile
'
).
then
(
grammar
=>
{
const
text
=
`%.o: %.c $(DEPS)
const
text
=
`CC=gcc
CFLAGS=-I.
DEPS = hellomake.h
OBJ = hellomake.o hellofunc.o
%.o: %.c $(DEPS)
\t$(CC) -c -o $@ $< $(CFLAGS)
hellomake: $(OBJ)
\t$(CC) -o $@ $^ $(CFLAGS)
`
.
split
(
"
\n
"
);
let
ruleStack
=
vsctm
.
INITIAL
;
for
(
let
i
=
0
;
i
<
text
.
length
;
i
++
)
{
const
line
=
text
[
i
];
const
lineTokens
=
grammar
.
tokenizeLine
(
line
,
ruleStack
);
console
.
log
(
grammar
.
_ruleId2desc
.
length
);
for
(
let
j
=
0
;
j
<
lineTokens
.
tokens
.
length
;
j
++
)
{
const
token
=
lineTokens
.
tokens
[
j
];
console
.
log
(
` - token from
${
token
.
startIndex
}
to
${
token
.
endIndex
}
`
+
...
...
vscode-tests/vendor/main.js
浏览文件 @
8d3d647b
...
...
@@ -924,7 +924,6 @@ function matchRule(grammar, lineText, isFirstLine, linePos, stack, anchorPositio
captureIndices
:
r
.
captureIndices
,
matchedRuleId
:
ruleScanner
.
rules
[
r
.
index
]
};
console
.
log
(
result
);
return
result
;
}
return
null
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录