Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Phodal
scie
提交
7a1c8aa1
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 搜索 >>
未验证
提交
7a1c8aa1
编写于
9月 08, 2020
作者:
P
Phodal Huang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: init scope depdency
上级
68970645
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
73 addition
and
10 deletion
+73
-10
scie-grammar/src/grammar/mod.rs
scie-grammar/src/grammar/mod.rs
+0
-1
scie-grammar/src/grammar_registry.rs
scie-grammar/src/grammar_registry.rs
+6
-8
scie-grammar/src/lib.rs
scie-grammar/src/lib.rs
+3
-1
scie-grammar/src/scope_dependency.rs
scie-grammar/src/scope_dependency.rs
+59
-0
scie-grammar/src/support/matcher.rs
scie-grammar/src/support/matcher.rs
+0
-0
scie-grammar/src/support/mod.rs
scie-grammar/src/support/mod.rs
+1
-0
scie-grammar/src/sync_register.rs
scie-grammar/src/sync_register.rs
+4
-0
未找到文件。
scie-grammar/src/grammar/mod.rs
浏览文件 @
7a1c8aa1
pub
mod
grammar
;
pub
mod
grammar_reader
;
pub
mod
grammar_registry
;
pub
mod
line_tokens
;
pub
mod
local_stack_element
;
...
...
scie-grammar/src/grammar
/grammar
_registry.rs
→
scie-grammar/src/grammar_registry.rs
浏览文件 @
7a1c8aa1
...
...
@@ -28,15 +28,13 @@ impl GrammarRegistry {
_
initial_scope_name
:
String
,
_
initial_language
:
i32
,
_
configuration
:
IGrammarConfiguration
,
)
{
)
{}
// todo: modify logic to here for _collectDependenciesForDep
pub
fn
_
load_grammar
(
&
self
,
initial_scope_name
:
String
,
_
initial_language
:
i32
,
_
token_type
:
Option
<
ITokenTypeMap
>
)
{
}
// todo: modify logic to here for _collectDependenciesForDep
pub
fn
load_grammar
(
&
self
,
_
initial_scope_name
:
String
,
_
initial_language
:
i32
,
_
configuration
:
IGrammarConfiguration
,
)
{
pub
fn
load_grammar
(
&
self
,
initial_scope_name
:
String
)
{
self
._load_grammar
(
initial_scope_name
,
0
,
None
)
}
}
scie-grammar/src/lib.rs
浏览文件 @
7a1c8aa1
...
...
@@ -11,6 +11,8 @@ extern crate regex;
pub
mod
grammar
;
pub
mod
inter
;
pub
mod
matcher
;
pub
mod
rule
;
pub
mod
support
;
pub
mod
grammar_registry
;
pub
mod
sync_register
;
pub
mod
scope_dependency
;
scie-grammar/src/scope_dependency.rs
0 → 100644
浏览文件 @
7a1c8aa1
use
crate
::
inter
::
IRawRule
;
use
std
::
collections
::
HashSet
;
#[derive(Clone,
Debug,
Serialize)]
pub
struct
PartialScopeDependency
{
pub
scope_name
:
String
,
pub
include
:
String
}
impl
PartialScopeDependency
{
pub
fn
to_key
(
&
self
)
->
String
{
format!
(
"{:?}#{:?}"
,
self
.scope_name
,
self
.include
)
}
}
#[derive(Clone,
Debug,
Serialize)]
pub
struct
FullScopeDependency
{
pub
scope_name
:
String
}
#[derive(Clone,
Debug,
Serialize)]
pub
enum
ScopeDependency
{
FullScopeDependency
(
FullScopeDependency
),
PartialScopeDependency
(
PartialScopeDependency
)
}
#[derive(Clone,
Debug,
Serialize)]
pub
struct
ScopeDependencyCollector
{
pub
full
:
Vec
<
FullScopeDependency
>
,
pub
partial
:
Vec
<
PartialScopeDependency
>
,
// pub visited_rule: HashSet<IRawRule>,
pub
_
seen_full
:
HashSet
<
String
>
,
pub
_
seen_partial
:
HashSet
<
String
>
,
}
impl
ScopeDependencyCollector
{
pub
fn
new
()
->
ScopeDependencyCollector
{
ScopeDependencyCollector
{
full
:
vec!
[],
partial
:
vec!
[],
// visited_rule: Default::default(),
_
seen_full
:
Default
::
default
(),
_
seen_partial
:
Default
::
default
()
}
}
pub
fn
add
(
&
mut
self
,
dep
:
ScopeDependency
)
{
match
dep
{
ScopeDependency
::
FullScopeDependency
(
full_dep
)
=>
{
// self._seen_full.get_or_insert(full_dep.scope_name);
// self._seen_full.get(&*full_dep.scope_name.clone());
},
ScopeDependency
::
PartialScopeDependency
(
_
)
=>
{
},
}
}
}
scie-grammar/src/matcher.rs
→
scie-grammar/src/
support/
matcher.rs
浏览文件 @
7a1c8aa1
文件已移动
scie-grammar/src/support/mod.rs
浏览文件 @
7a1c8aa1
pub
mod
regex_source
;
pub
mod
matcher
;
scie-grammar/src/sync_register.rs
0 → 100644
浏览文件 @
7a1c8aa1
pub
struct
SyncRegister
{
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录