Skip to content

Commit 9436476

Browse files
introduce gen declaration
(refs: #2349)
1 parent 4a36103 commit 9436476

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+32849
-31227
lines changed

crates/aligner/src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,10 @@ impl Align {
7272
}
7373

7474
pub fn start_item(&mut self) {
75-
self.enable = true;
76-
self.width = 0;
75+
if !self.enable {
76+
self.enable = true;
77+
self.width = 0;
78+
}
7779
}
7880

7981
fn token(&mut self, x: &VerylToken) {

crates/analyzer/src/analyzer_error.rs

Lines changed: 5 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,30 +1386,12 @@ pub enum AnalyzerError {
13861386

13871387
#[diagnostic(
13881388
severity(Error),
1389-
code(unresolvable_generic_argument),
1389+
code(unresolvable_generic_expression),
13901390
help(""),
13911391
url("https://doc.veryl-lang.org/book/07_appendix/02_semantic_error.html#{}", self.code().unwrap())
13921392
)]
13931393
#[error("\"{identifier}\" can't be resolved from the definition of generics")]
1394-
UnresolvableGenericArgument {
1395-
identifier: String,
1396-
#[source_code]
1397-
input: MultiSources,
1398-
#[label("Error location")]
1399-
error_location: SourceSpan,
1400-
#[label("Definition")]
1401-
definition_location: SourceSpan,
1402-
token_source: TokenSource,
1403-
},
1404-
1405-
#[diagnostic(
1406-
severity(Error),
1407-
code(unresolvable_generic_reference),
1408-
help(""),
1409-
url("")
1410-
)]
1411-
#[error("\"{identifier}\" can't be resolved from the definition of generics")]
1412-
UnresolvableGenericReference {
1394+
UnresolvableGenericExpression {
14131395
identifier: String,
14141396
#[source_code]
14151397
input: MultiSources,
@@ -1629,8 +1611,7 @@ impl AnalyzerError {
16291611
AnalyzerError::UnknownParam { token_source, .. } => *token_source,
16301612
AnalyzerError::UnknownPort { token_source, .. } => *token_source,
16311613
AnalyzerError::UnknownUnsafe { token_source, .. } => *token_source,
1632-
AnalyzerError::UnresolvableGenericArgument { token_source, .. } => *token_source,
1633-
AnalyzerError::UnresolvableGenericReference { token_source, .. } => *token_source,
1614+
AnalyzerError::UnresolvableGenericExpression { token_source, .. } => *token_source,
16341615
AnalyzerError::UnsignedLoopVariableInDescendingOrderForLoop {
16351616
token_source, ..
16361617
} => *token_source,
@@ -2397,25 +2378,12 @@ impl AnalyzerError {
23972378
token_source: token.source(),
23982379
}
23992380
}
2400-
pub fn unresolvable_generic_argument(
2401-
identifier: &str,
2402-
token: &TokenRange,
2403-
definition_token: &TokenRange,
2404-
) -> Self {
2405-
AnalyzerError::UnresolvableGenericArgument {
2406-
identifier: identifier.to_string(),
2407-
input: source(token),
2408-
error_location: token.into(),
2409-
definition_location: definition_token.into(),
2410-
token_source: token.source(),
2411-
}
2412-
}
2413-
pub fn unresolvable_generic_reference(
2381+
pub fn unresolvable_generic_expression(
24142382
identifier: &str,
24152383
token: &TokenRange,
24162384
definition_token: &TokenRange,
24172385
) -> Self {
2418-
AnalyzerError::UnresolvableGenericReference {
2386+
AnalyzerError::UnresolvableGenericExpression {
24192387
identifier: identifier.to_string(),
24202388
input: source(token),
24212389
error_location: token.into(),

0 commit comments

Comments
 (0)