-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[YAMLParser] Improve plain scalar spec compliance (#68946)
The `YAMLParser.h` header file claims support for YAML 1.2 with a few deviations, but our plain scalar parsing failed to parse some valid YAML according to the spec. This change puts us more in compliance with the YAML spec, now letting us parse plain scalars containing additional special characters in cases where they are not ambiguous.
- Loading branch information
1 parent
2a40ec2
commit 4480e65
Showing
5 changed files
with
137 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
llvm/test/CodeGen/MIR/Generic/first-character-parse-error.mir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# RUN: yaml-bench -canonical %s | FileCheck %s | ||
# Example from https://yaml.org/spec/1.2.2/#example-plain-characters | ||
|
||
# Outside flow collection: | ||
- ::vector | ||
- ": - ()" | ||
- Up, up, and away! | ||
- -123 | ||
- https://example.com/foo#bar | ||
# Inside flow collection: | ||
- [ ::vector, | ||
": - ()", | ||
"Up, up and away!", | ||
-123, | ||
https://example.com/foo#bar ] | ||
|
||
# CHECK: !!seq [ | ||
# CHECK-NEXT: !!str "::vector", | ||
# CHECK-NEXT: !!str ": - ()", | ||
# CHECK-NEXT: !!str "Up, up, and away!", | ||
# CHECK-NEXT: !!str "-123", | ||
# CHECK-NEXT: !!str "https://example.com/foo#bar", | ||
# CHECK-NEXT: !!seq [ | ||
# CHECK-NEXT: !!str "::vector", | ||
# CHECK-NEXT: !!str ": - ()", | ||
# CHECK-NEXT: !!str "Up, up and away!", | ||
# CHECK-NEXT: !!str "-123", | ||
# CHECK-NEXT: !!str "https://example.com/foo#bar", | ||
# CHECK-NEXT: ], | ||
# CHECK-NEXT: ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters