Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
name: Parsing keys with accented characters
contentFile: key-accented-chars.yaml
rangeLength: -1
startOffset: 0
expectedTokens:

- type: DOCUMENT_START

# Poèmes
- type: WHITESPACE
- type: KEY

# Poème1
- type: WHITESPACE
- type: KEY

- type: WHITESPACE
- type: KEY
- type: WHITESPACE
- type: SCALAR

- type: WHITESPACE
- type: KEY
- type: WHITESPACE
- type: SCALAR

- type: WHITESPACE
- type: KEY
- type: WHITESPACE
- type: SCALAR

# Prop2
- type: WHITESPACE
- type: KEY

- type: WHITESPACE
- type: KEY
- type: WHITESPACE
- type: SCALAR

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
Poèmes:
Poème1:
MaîtreCorbeau: value
SurUnArbrePerché: value
î: value
Prop2:
grünen: value

Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ public static Collection<Object[]> readTests() {
"comment-tests.yaml",
"tag-tests.yaml",
"scalar-test.yaml",
"key-tests.yaml"
"key-tests.yaml",
"key-accented-chars-tests.yaml"
};

Collection<Object[]> testCases = new ArrayList<Object[]>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
*/
public class KeyRule implements IRule {

private IToken token;
private IToken token;
private Pattern keyPattern;

public KeyRule( IToken token ){
this.token = token;
keyPattern = Pattern.compile( getKeyRegex(), Pattern.DOTALL | Pattern.COMMENTS );
keyPattern = Pattern.compile( getKeyRegex(), Pattern.DOTALL | Pattern.COMMENTS | Pattern.UNICODE_CHARACTER_CLASS);
}

public IToken evaluate(ICharacterScanner scanner) {
Expand Down