Skip to content
This repository was archived by the owner on Mar 8, 2020. It is now read-only.

Commit bb726b6

Browse files
Denys Smirnovdennwc
authored andcommitted
fix unicode positions
Signed-off-by: Denys Smirnov <[email protected]>
1 parent d7816a1 commit bb726b6

File tree

8 files changed

+77537
-77529
lines changed

8 files changed

+77537
-77529
lines changed

driver/fixtures/fixtures_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ var Suite = &fixtures.Suite{
3434
"ASTInclusionStatement",
3535
},
3636
},
37+
// TODO: This won't really work because of the C++ macros expansion.
38+
// The native AST includes an expanded macros as a token
39+
// but we expect the token to match the source file exactly.
40+
//VerifyTokens: []positioner.VerifyToken{
41+
// {Types: []string{
42+
// "CPPASTLiteralExpression",
43+
// }},
44+
//},
3745
}
3846

3947
func TestCppDriver(t *testing.T) {

driver/normalizer/normalizer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ var Preprocess = Transformers([][]Transformer{
1919
}...)
2020

2121
var PreprocessCode = []CodeTransformer{
22-
positioner.FromOffset(),
22+
positioner.FromUTF16Offset(),
2323
}
2424

2525
var Normalize = Transformers([][]Transformer{

fixtures/cpp17_2.cpp.sem.uast

Lines changed: 16623 additions & 16623 deletions
Large diffs are not rendered by default.

fixtures/cpp17_2.cpp.uast

Lines changed: 18579 additions & 18579 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)