diff --git a/.github/workflows/test_and_publish.yml b/.github/workflows/test_and_publish.yml index 8de06ff..ba66c1a 100644 --- a/.github/workflows/test_and_publish.yml +++ b/.github/workflows/test_and_publish.yml @@ -10,12 +10,13 @@ jobs: unit_tests: runs-on: "${{ matrix.os }}" strategy: + fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] node: [18] steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: "${{ matrix.node-version }}" cache: "npm" @@ -26,8 +27,8 @@ jobs: integration_tests: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 cache: "npm" @@ -44,8 +45,8 @@ jobs: if: startsWith(github.event.ref, 'refs/tags/v') runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: 18 cache: "npm" diff --git a/src/parse/parse_parameters.ts b/src/parse/parse_parameters.ts index 886d5e2..8e7e85d 100644 --- a/src/parse/parse_parameters.ts +++ b/src/parse/parse_parameters.ts @@ -90,7 +90,7 @@ function parseReturn(parameters: string[], body: string[]): Returns { const returnType = parseReturnFromDefinition(parameters); if (returnType == null || isIterator(returnType.type)) { - return parseFromBody(body, /return /); + return parseFromBody(body, /(?:^|\W)return /); } return returnType; @@ -105,7 +105,7 @@ function parseYields(parameters: string[], body: string[]): Yields { // To account for functions that yield but don't have a yield signature const yieldType = returnType ? returnType.type : undefined; - const yieldInBody = parseFromBody(body, /yield /); + const yieldInBody = parseFromBody(body, /(?:^|\W)yield /); if (yieldInBody != null && yieldType != undefined) { yieldInBody.type = `Iterator[${yieldType}]`;