-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: [cxx-parser] Add SimpleType.lenOfArrayType extension
- Loading branch information
1 parent
866d883
commit 4247ef7
Showing
3 changed files
with
50 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import fs from 'fs'; | ||
import os from 'os'; | ||
import path from 'path'; | ||
|
||
import '../../src/cxx_terra_node_ext'; | ||
import { SimpleType, SimpleTypeKind } from '../../src/cxx_terra_node'; | ||
|
||
describe('cxx_terra_node_ext', () => { | ||
it('lenOfArrayType can get len of array type', () => { | ||
let simpleType = new SimpleType(); | ||
simpleType.kind = SimpleTypeKind.array_t; | ||
simpleType.source = 'int[10]'; | ||
|
||
let len = simpleType.lenOfArrayType(); | ||
expect(len).toBe('10'); | ||
}); | ||
}); |
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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
export * from './cxx_terra_node'; | ||
// This should be above the `cxx_terra_node`, or it will throw TypeError: Cannot read properties of undefined (reading 'xxx') | ||
export * from './cxx_terra_node_ext'; | ||
export * from './cxx_terra_node'; | ||
export * from './cxx_parser_configs'; | ||
export * from './cxx_parser'; | ||
// This should be above the `cxx_parser`, or it will throw TypeError: Cannot read properties of undefined (reading 'xxx') | ||
export * from './cxx_parser_ext'; | ||
export * from './cxx_parser'; |