Skip to content

Commit

Permalink
Merge branch 'main' into fix/structs
Browse files Browse the repository at this point in the history
  • Loading branch information
0xGorilla authored Jan 9, 2024
2 parents 8fc3345 + 4973559 commit 488fdc9
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
23 changes: 17 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
name: Node.js CI
name: Tests

on: push

permissions: write-all
permissions: read-all

env:
SOL_AST_COMPILER_CACHE: ${{ github.workspace }}/.compiler_cache

jobs:
build:
Expand All @@ -20,9 +23,17 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- run: yarn install
- name: Install Solc AST binary
run: yarn global add solc-typed-ast

- name: Install dependencies
run: yarn install

- run: yarn test
env:
SOL_AST_COMPILER_CACHE: /home/runner/work/_temp/.compiler_cache
- name: Pre-download compilers from historical builds archive
run: |
sol-ast-compile --download-compilers native wasm
find $SOL_AST_COMPILER_CACHE -name 'list.json' -delete
find $SOL_AST_COMPILER_CACHE -name '*v0.5.17*' -delete
- name: Run tests
run: yarn test
4 changes: 2 additions & 2 deletions sample-data/BasicSample.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ contract BasicSample {
/**
* @notice External function that returns a bool
* @dev A dev comment
* @param _magicNumber A parameter description
* @param _magicNumber A parameter description
* @param _name Another parameter description
* @return _isMagic Some return data
*/
Expand Down Expand Up @@ -50,7 +50,7 @@ contract BasicSample {
* @notice External function that returns a bool
* @dev A dev comment
* @param _magicNumber A parameter description
* @param _name Another parameter description
* @param _name Another parameter description
* @return _isMagic Some return data
* @return Test test
*/
Expand Down
4 changes: 2 additions & 2 deletions src/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ export function parseNodeNatspec(node: SolcContractNode): Natspec {
result.inheritdoc = { content: tagMatch[2] };
}
} else if (tagName === 'param' || tagName === 'return') {
const tagMatch = line.match(/^\s*@(\w+) (\w+) (.*)$/);
const tagMatch = line.match(/^\s*@(\w+) *(\w+) (.*)$/);
if (tagMatch) {
currentTag = { name: tagMatch[2], content: tagMatch[3].trim() };
result[tagName === 'param' ? 'params' : 'returns'].push(currentTag);
}
} else {
const tagMatch = line.match(/^\s*@(\w+) (.*)$/);
const tagMatch = line.match(/^\s*@(\w+) *(.*)$/);
if (tagMatch) {
currentTag = { name: tagName, content: tagMatch[2] };
result.tags.push(currentTag);
Expand Down

0 comments on commit 488fdc9

Please sign in to comment.