Skip to content

Commit

Permalink
bugfix: make doc parser compatible with attr : type and attr: type (
Browse files Browse the repository at this point in the history
  • Loading branch information
He1pa committed Jul 31, 2023
1 parent 0b64afa commit 82d149c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions kclvm/sema/src/resolver/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,9 @@ fn parse_attr_list(content: String) -> Vec<Attribute> {
while !r.eof() {
let header = r.read();
let header = header.trim();
if header.contains(" : ") {
let parts: Vec<&str> = header.split(" : ").collect();
let arg_name = parts[0];
if header.contains(": ") {
let parts: Vec<&str> = header.split(": ").collect();
let arg_name = parts[0].trim();

let desc_lines = r
.read_to_next_unindented_line()
Expand Down Expand Up @@ -350,7 +350,7 @@ de",
A Server-level attribute.
The name of the long-running service.
See also: kusion_models/core/v1/metadata.k.
labels : {str:str}, optional
labels: {str:str}, optional
A Server-level attribute.
The labels of the long-running service.
See also: kusion_models/core/v1/metadata.k.
Expand Down Expand Up @@ -388,7 +388,7 @@ name : str, required
A Server-level attribute.
The name of the long-running service.
See also: kusion_models/core/v1/metadata.k.
labels : {str:str}, optional
labels: {str:str}, optional
A Server-level attribute.
The labels of the long-running service.
See also: kusion_models/core/v1/metadata.k.
Expand Down
2 changes: 1 addition & 1 deletion kclvm/sema/src/resolver/test_data/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
A Server-level attribute.
The name of the long-running service.
See also: kusion_models/core/v1/metadata.k.
labels : {str:str}, optional
labels: {str:str}, optional
A Server-level attribute.
The labels of the long-running service.
See also: kusion_models/core/v1/metadata.k.
Expand Down

0 comments on commit 82d149c

Please sign in to comment.