diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..f1a9f8eb --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,174 @@ +# This file was automatically generated by sbt-github-actions using the +# githubWorkflowGenerate task. You should add and commit this file to +# your git repository. It goes without saying that you shouldn't edit +# this file by hand! Instead, if you wish to make changes, you should +# change your sbt build configuration to revise the workflow description +# to meet your needs, then regenerate this file. + +name: Continuous Integration + +on: + pull_request: + branches: ['**'] + push: + branches: ['**'] + tags: [v*] + +env: + PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} + SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} + PGP_SECRET: ${{ secrets.PGP_SECRET }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +jobs: + build: + name: Build and Test + strategy: + matrix: + os: [ubuntu-latest] + scala: [3.0.2, 2.13.6, 2.12.15] + java: [temurin@8] + project: [rootJS, rootJVM, rootNative] + exclude: + - scala: 3.0.2 + project: rootNative + runs-on: ${{ matrix.os }} + steps: + - name: Checkout current branch (full) + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Setup Java (temurin@8) + if: matrix.java == 'temurin@8' + uses: actions/setup-java@v2 + with: + distribution: temurin + java-version: 8 + + - name: Cache sbt + uses: actions/cache@v2 + with: + path: | + ~/.sbt + ~/.ivy2/cache + ~/.coursier/cache/v1 + ~/.cache/coursier/v1 + ~/AppData/Local/Coursier/Cache/v1 + ~/Library/Caches/Coursier/v1 + key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + + - name: Check that workflows are up to date + run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' 'project /' githubWorkflowCheck + + - name: Check headers and formatting + run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' headerCheckAll scalafmtCheckAll 'project /' scalafmtSbtCheck + + - name: fastOptJS + if: matrix.project == 'rootJS' + run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' Test/fastOptJS + + - name: nativeLink + if: matrix.project == 'rootNative' + run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' Test/nativeLink + + - name: Test + run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' test + + - name: Check binary compatibility + run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' mimaReportBinaryIssues + + - name: Generate API documentation + run: sbt 'project ${{ matrix.project }}' '++${{ matrix.scala }}' doc + + - name: Make target directories + run: mkdir -p util/native/target target parser/jvm/target .js/target parser/js/target ast/native/target ast/jvm/target parser/native/target ast/js/target .jvm/target .native/target util/js/target util/jvm/target benchmark/target project/target + + - name: Compress target directories + run: tar cf targets.tar util/native/target target parser/jvm/target .js/target parser/js/target ast/native/target ast/jvm/target parser/native/target ast/js/target .jvm/target .native/target util/js/target util/jvm/target benchmark/target project/target + + - name: Upload target directories + uses: actions/upload-artifact@v2 + with: + name: target-${{ matrix.os }}-${{ matrix.scala }}-${{ matrix.java }} + path: targets.tar + + publish: + name: Publish Artifacts + needs: [build] + if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') + strategy: + matrix: + os: [ubuntu-latest] + scala: [2.12.15] + java: [temurin@8] + runs-on: ${{ matrix.os }} + steps: + - name: Checkout current branch (full) + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Setup Java (temurin@8) + if: matrix.java == 'temurin@8' + uses: actions/setup-java@v2 + with: + distribution: temurin + java-version: 8 + + - name: Cache sbt + uses: actions/cache@v2 + with: + path: | + ~/.sbt + ~/.ivy2/cache + ~/.coursier/cache/v1 + ~/.cache/coursier/v1 + ~/AppData/Local/Coursier/Cache/v1 + ~/Library/Caches/Coursier/v1 + key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + + - name: Download target directories (3.0.2) + uses: actions/download-artifact@v2 + with: + name: target-${{ matrix.os }}-3.0.2-${{ matrix.java }} + + - name: Inflate target directories (3.0.2) + run: | + tar xf targets.tar + rm targets.tar + + - name: Download target directories (2.13.6) + uses: actions/download-artifact@v2 + with: + name: target-${{ matrix.os }}-2.13.6-${{ matrix.java }} + + - name: Inflate target directories (2.13.6) + run: | + tar xf targets.tar + rm targets.tar + + - name: Download target directories (2.12.15) + uses: actions/download-artifact@v2 + with: + name: target-${{ matrix.os }}-2.12.15-${{ matrix.java }} + + - name: Inflate target directories (2.12.15) + run: | + tar xf targets.tar + rm targets.tar + + - name: Import signing key + if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE == '' + run: echo $PGP_SECRET | base64 -d | gpg --import + + - name: Import signing key and strip passphrase + if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE != '' + run: | + echo "$PGP_SECRET" | base64 -d > /tmp/signing-key.gpg + echo "$PGP_PASSPHRASE" | gpg --pinentry-mode loopback --passphrase-fd 0 --import /tmp/signing-key.gpg + (echo "$PGP_PASSPHRASE"; echo; echo) | gpg --command-fd 0 --pinentry-mode loopback --change-passphrase $(gpg --list-secret-keys --with-colons 2> /dev/null | grep '^sec:' | cut --delimiter ':' --fields 5 | tail -n 1) + + - name: Publish + run: sbt '++${{ matrix.scala }}' tlRelease diff --git a/.github/workflows/clean.yml b/.github/workflows/clean.yml new file mode 100644 index 00000000..547aaa43 --- /dev/null +++ b/.github/workflows/clean.yml @@ -0,0 +1,59 @@ +# This file was automatically generated by sbt-github-actions using the +# githubWorkflowGenerate task. You should add and commit this file to +# your git repository. It goes without saying that you shouldn't edit +# this file by hand! Instead, if you wish to make changes, you should +# change your sbt build configuration to revise the workflow description +# to meet your needs, then regenerate this file. + +name: Clean + +on: push + +jobs: + delete-artifacts: + name: Delete Artifacts + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - name: Delete artifacts + run: | + # Customize those three lines with your repository and credentials: + REPO=${GITHUB_API_URL}/repos/${{ github.repository }} + + # A shortcut to call GitHub API. + ghapi() { curl --silent --location --user _:$GITHUB_TOKEN "$@"; } + + # A temporary file which receives HTTP response headers. + TMPFILE=/tmp/tmp.$$ + + # An associative array, key: artifact name, value: number of artifacts of that name. + declare -A ARTCOUNT + + # Process all artifacts on this repository, loop on returned "pages". + URL=$REPO/actions/artifacts + while [[ -n "$URL" ]]; do + + # Get current page, get response headers in a temporary file. + JSON=$(ghapi --dump-header $TMPFILE "$URL") + + # Get URL of next page. Will be empty if we are at the last page. + URL=$(grep '^Link:' "$TMPFILE" | tr ',' '\n' | grep 'rel="next"' | head -1 | sed -e 's/.*.*//') + rm -f $TMPFILE + + # Number of artifacts on this page: + COUNT=$(( $(jq <<<$JSON -r '.artifacts | length') )) + + # Loop on all artifacts on this page. + for ((i=0; $i < $COUNT; i++)); do + + # Get name of artifact and count instances of this name. + name=$(jq <<<$JSON -r ".artifacts[$i].name?") + ARTCOUNT[$name]=$(( $(( ${ARTCOUNT[$name]} )) + 1)) + + id=$(jq <<<$JSON -r ".artifacts[$i].id?") + size=$(( $(jq <<<$JSON -r ".artifacts[$i].size_in_bytes?") )) + printf "Deleting '%s' #%d, %'d bytes\n" $name ${ARTCOUNT[$name]} $size + ghapi -X DELETE $REPO/actions/artifacts/$id + done + done diff --git a/.github/workflows/scala.yml b/.github/workflows/scala.yml deleted file mode 100644 index 7e1a248b..00000000 --- a/.github/workflows/scala.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Scala - -on: [push, pull_request] - -jobs: - build: - - runs-on: ubuntu-latest - - strategy: - matrix: - scala: [2.12.15, 2.13.6, 3.0.0] - - steps: - - uses: actions/checkout@v2 - - uses: olafurpg/setup-scala@v10 - with: - java-version: openjdk@1.11.0 - - name: Scalafmt - if: startsWith(matrix.scala, '2.13') - run: sbt scalafmtSbtCheck scalafmtCheckAll - - name: Run tests - run: sbt ++${{matrix.scala}} test - - name: MiMa - run: sbt ++${{matrix.scala}} mimaReportBinaryIssues diff --git a/ast/js/src/main/scala/jawn/ast/JParserPlatform.scala b/ast/js/src/main/scala/jawn/ast/JParserPlatform.scala index 35d00f3c..3565e143 100644 --- a/ast/js/src/main/scala/jawn/ast/JParserPlatform.scala +++ b/ast/js/src/main/scala/jawn/ast/JParserPlatform.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn package ast diff --git a/ast/js/src/test/scala/jawn/ast/AstCheckPlatform.scala b/ast/js/src/test/scala/jawn/ast/AstCheckPlatform.scala index 26f68729..352051c8 100644 --- a/ast/js/src/test/scala/jawn/ast/AstCheckPlatform.scala +++ b/ast/js/src/test/scala/jawn/ast/AstCheckPlatform.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn package ast diff --git a/ast/js/src/test/scala/jawn/ast/AstTestPlatform.scala b/ast/js/src/test/scala/jawn/ast/AstTestPlatform.scala index 2c9b4e01..47f789b8 100644 --- a/ast/js/src/test/scala/jawn/ast/AstTestPlatform.scala +++ b/ast/js/src/test/scala/jawn/ast/AstTestPlatform.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn package ast diff --git a/ast/jvm/src/main/scala/jawn/ast/JParserPlatform.scala b/ast/jvm/src/main/scala/jawn/ast/JParserPlatform.scala index 98388680..b51c6788 100644 --- a/ast/jvm/src/main/scala/jawn/ast/JParserPlatform.scala +++ b/ast/jvm/src/main/scala/jawn/ast/JParserPlatform.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn package ast diff --git a/ast/jvm/src/test/scala/jawn/ast/AstCheckPlatform.scala b/ast/jvm/src/test/scala/jawn/ast/AstCheckPlatform.scala index 425c0a1a..de5e3f8e 100644 --- a/ast/jvm/src/test/scala/jawn/ast/AstCheckPlatform.scala +++ b/ast/jvm/src/test/scala/jawn/ast/AstCheckPlatform.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn package ast diff --git a/ast/jvm/src/test/scala/jawn/ast/AstTestPlatform.scala b/ast/jvm/src/test/scala/jawn/ast/AstTestPlatform.scala index a0aad57a..a6eb18f0 100644 --- a/ast/jvm/src/test/scala/jawn/ast/AstTestPlatform.scala +++ b/ast/jvm/src/test/scala/jawn/ast/AstTestPlatform.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn package ast diff --git a/ast/native/src/main/scala/jawn/ast/JParserPlatform.scala b/ast/native/src/main/scala/jawn/ast/JParserPlatform.scala index 35d00f3c..3565e143 100644 --- a/ast/native/src/main/scala/jawn/ast/JParserPlatform.scala +++ b/ast/native/src/main/scala/jawn/ast/JParserPlatform.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn package ast diff --git a/ast/native/src/test/scala/jawn/ast/AstCheckPlatform.scala b/ast/native/src/test/scala/jawn/ast/AstCheckPlatform.scala index 26f68729..352051c8 100644 --- a/ast/native/src/test/scala/jawn/ast/AstCheckPlatform.scala +++ b/ast/native/src/test/scala/jawn/ast/AstCheckPlatform.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn package ast diff --git a/ast/native/src/test/scala/jawn/ast/AstTestPlatform.scala b/ast/native/src/test/scala/jawn/ast/AstTestPlatform.scala index 2c9b4e01..47f789b8 100644 --- a/ast/native/src/test/scala/jawn/ast/AstTestPlatform.scala +++ b/ast/native/src/test/scala/jawn/ast/AstTestPlatform.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn package ast diff --git a/ast/shared/src/main/scala/jawn/ast/JParser.scala b/ast/shared/src/main/scala/jawn/ast/JParser.scala index 9e7a2137..a362adc6 100644 --- a/ast/shared/src/main/scala/jawn/ast/JParser.scala +++ b/ast/shared/src/main/scala/jawn/ast/JParser.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn package ast diff --git a/ast/shared/src/main/scala/jawn/ast/JValue.scala b/ast/shared/src/main/scala/jawn/ast/JValue.scala index d9da7696..31354155 100644 --- a/ast/shared/src/main/scala/jawn/ast/JValue.scala +++ b/ast/shared/src/main/scala/jawn/ast/JValue.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn package ast diff --git a/ast/shared/src/main/scala/jawn/ast/JawnFacade.scala b/ast/shared/src/main/scala/jawn/ast/JawnFacade.scala index a892da58..89309863 100644 --- a/ast/shared/src/main/scala/jawn/ast/JawnFacade.scala +++ b/ast/shared/src/main/scala/jawn/ast/JawnFacade.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn package ast diff --git a/ast/shared/src/main/scala/jawn/ast/Renderer.scala b/ast/shared/src/main/scala/jawn/ast/Renderer.scala index 9e37c5c5..4b12cd40 100644 --- a/ast/shared/src/main/scala/jawn/ast/Renderer.scala +++ b/ast/shared/src/main/scala/jawn/ast/Renderer.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn package ast diff --git a/ast/shared/src/test/scala/jawn/ArbitraryUtil.scala b/ast/shared/src/test/scala/jawn/ArbitraryUtil.scala index 0f90c868..83280bcd 100644 --- a/ast/shared/src/test/scala/jawn/ArbitraryUtil.scala +++ b/ast/shared/src/test/scala/jawn/ArbitraryUtil.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn package ast diff --git a/ast/shared/src/test/scala/jawn/AstCheck.scala b/ast/shared/src/test/scala/jawn/AstCheck.scala index c186a120..6da97e4f 100644 --- a/ast/shared/src/test/scala/jawn/AstCheck.scala +++ b/ast/shared/src/test/scala/jawn/AstCheck.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn package ast diff --git a/ast/shared/src/test/scala/jawn/AstTest.scala b/ast/shared/src/test/scala/jawn/AstTest.scala index b0088922..e7adc509 100644 --- a/ast/shared/src/test/scala/jawn/AstTest.scala +++ b/ast/shared/src/test/scala/jawn/AstTest.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn package ast diff --git a/benchmark/build.sbt b/benchmark/build.sbt index 435f24ce..0f2423f8 100644 --- a/benchmark/build.sbt +++ b/benchmark/build.sbt @@ -2,20 +2,24 @@ name := "jawn-benchmarks" run / javaOptions += "-Xmx6G" -libraryDependencies ++= Seq( - "io.argonaut" %% "argonaut" % "6.2.3", - "org.json4s" %% "json4s-native" % "3.5.4", - "org.json4s" %% "json4s-jackson" % "3.5.4", - "com.typesafe.play" %% "play-json" % "2.6.9", - "com.rojoma" %% "rojoma-json" % "2.4.3", - "com.rojoma" %% "rojoma-json-v3" % "3.8.0", - "io.spray" %% "spray-json" % "1.3.4", - "org.parboiled" %% "parboiled" % "2.1.4", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.9.6", - "com.fasterxml.jackson.core" % "jackson-core" % "2.9.6", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.6", - "com.google.code.gson" % "gson" % "2.8.5" -) +libraryDependencies ++= { + if (scalaBinaryVersion.value.startsWith("2.12")) + Seq( + "io.argonaut" %% "argonaut" % "6.2.3", + "org.json4s" %% "json4s-native" % "3.5.4", + "org.json4s" %% "json4s-jackson" % "3.5.4", + "com.typesafe.play" %% "play-json" % "2.6.9", + "com.rojoma" %% "rojoma-json" % "2.4.3", + "com.rojoma" %% "rojoma-json-v3" % "3.8.0", + "io.spray" %% "spray-json" % "1.3.4", + "org.parboiled" %% "parboiled" % "2.1.4", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.9.6", + "com.fasterxml.jackson.core" % "jackson-core" % "2.9.6", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.6", + "com.google.code.gson" % "gson" % "2.8.5" + ) + else Nil +} // enable forking in run run / fork := true diff --git a/benchmark/src/main/scala/jawn/JmhBenchmarks.scala b/benchmark/src/main/scala-2.12/jawn/JmhBenchmarks.scala similarity index 75% rename from benchmark/src/main/scala/jawn/JmhBenchmarks.scala rename to benchmark/src/main/scala-2.12/jawn/JmhBenchmarks.scala index 10b318e9..7a0a4334 100644 --- a/benchmark/src/main/scala/jawn/JmhBenchmarks.scala +++ b/benchmark/src/main/scala-2.12/jawn/JmhBenchmarks.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn package benchmark diff --git a/benchmark/src/main/scala-2.12/jawn/Parboiled.scala b/benchmark/src/main/scala-2.12/jawn/Parboiled.scala new file mode 100644 index 00000000..112a0d25 --- /dev/null +++ b/benchmark/src/main/scala-2.12/jawn/Parboiled.scala @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +package org.typelevel.jawn.benchmark + +/* + * Copyright (C) 2009-2013 Mathias Doenitz, Alexander Myltsev + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import scala.annotation.switch +import org.parboiled2._ +import spray.json.{ParserInput => _, _} + +/** + * This is a feature-complete JSON parser implementation that almost directly models the JSON grammar presented at + * http://www.json.org as a parboiled2 PEG parser. + */ +class ParboiledParser(val input: ParserInput) extends Parser with StringBuilding { + import CharPredicate.{Digit, Digit19, HexDigit} + import ParboiledParser._ + + // the root rule + def Json = rule(WhiteSpace ~ Value ~ EOI) + + def JsonObject: Rule1[JsObject] = rule { + ws('{') ~ zeroOrMore(Pair).separatedBy(ws(',')) ~ ws('}') ~> ((fields: Seq[JsField]) => JsObject(fields: _*)) + } + + def Pair = rule(JsonStringUnwrapped ~ ws(':') ~ Value ~> ((_, _))) + + def Value: Rule1[JsValue] = rule { + // as an optimization of the equivalent rule: + // JsonString | JsonNumber | JsonObject | JsonArray | JsonTrue | JsonFalse | JsonNull + // we make use of the fact that one-char lookahead is enough to discriminate the cases + run { + (cursorChar: @switch) match { + case '"' => JsonString + case '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '-' => JsonNumber + case '{' => JsonObject + case '[' => JsonArray + case 't' => JsonTrue + case 'f' => JsonFalse + case 'n' => JsonNull + case _ => MISMATCH + } + } + } + + def JsonString = rule(JsonStringUnwrapped ~> (JsString(_))) + + def JsonStringUnwrapped = rule('"' ~ clearSB() ~ Characters ~ ws('"') ~ push(sb.toString)) + + def JsonNumber = rule(capture(Integer ~ optional(Frac) ~ optional(Exp)) ~> (JsNumber(_)) ~ WhiteSpace) + + def JsonArray = rule(ws('[') ~ zeroOrMore(Value).separatedBy(ws(',')) ~ ws(']') ~> (JsArray(_: _*))) + + def Characters = rule(zeroOrMore(NormalChar | '\\' ~ EscapedChar)) + + def NormalChar = rule(!QuoteBackslash ~ ANY ~ appendSB()) + + def EscapedChar = rule( + QuoteSlashBackSlash ~ appendSB() + | 'b' ~ appendSB('\b') + | 'f' ~ appendSB('\f') + | 'n' ~ appendSB('\n') + | 'r' ~ appendSB('\r') + | 't' ~ appendSB('\t') + | Unicode ~> { code => sb.append(code.asInstanceOf[Char]); () } + ) + + def Unicode = rule('u' ~ capture(HexDigit ~ HexDigit ~ HexDigit ~ HexDigit) ~> (java.lang.Integer.parseInt(_, 16))) + + def Integer = rule(optional('-') ~ (Digit19 ~ Digits | Digit)) + + def Digits = rule(oneOrMore(Digit)) + + def Frac = rule("." ~ Digits) + + def Exp = rule(ignoreCase('e') ~ optional(anyOf("+-")) ~ Digits) + + def JsonTrue = rule("true" ~ WhiteSpace ~ push(JsTrue)) + + def JsonFalse = rule("false" ~ WhiteSpace ~ push(JsFalse)) + + def JsonNull = rule("null" ~ WhiteSpace ~ push(JsNull)) + + def WhiteSpace = rule(zeroOrMore(WhiteSpaceChar)) + + def ws(c: Char) = rule(c ~ WhiteSpace) +} + +object ParboiledParser { + val WhiteSpaceChar = CharPredicate(" \n\r\t\f") + val QuoteBackslash = CharPredicate("\"\\") + val QuoteSlashBackSlash = QuoteBackslash ++ "/" +} diff --git a/benchmark/src/main/scala/ParseLongBench.scala b/benchmark/src/main/scala/ParseLongBench.scala new file mode 100644 index 00000000..f92fa01b --- /dev/null +++ b/benchmark/src/main/scala/ParseLongBench.scala @@ -0,0 +1,150 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +package org.typelevel.jawn +package benchmark + +import java.util.concurrent.TimeUnit + +import org.openjdk.jmh.annotations._ + +case class Slice(s: String, begin: Int, limit: Int) extends CharSequence { + val length: Int = limit - begin + def charAt(i: Int): Char = s.charAt(begin + i) + def subSequence(start: Int, end: Int): Slice = + Slice(s, begin + start, Math.min(end + begin, limit)) + override def toString: String = + s.substring(begin, limit) +} + +@State(Scope.Benchmark) +@OutputTimeUnit(TimeUnit.MILLISECONDS) +class ParseLongBench { + + val longs: Array[Long] = Array(-1346837161442476189L, -4666345991836441070L, 4868830844043235709L, + 2992690405064579158L, -2017521011608078634L, -3039682866169364757L, + 8997687047891586260L, 5932727796276454607L, 4062739618560250554L, 8668950167358198490L, + -8565613821858118870L, 8049785848575684314L, -580831266940599830L, + -3593199367295538945L, 8374322595267797482L, 3088261552516619129L, + -6879203747403593851L, -1842900848925949857L, 4484592876047641351L, + 5182973278356955602L, -6840392853855436945L, -4176340556015032222L, + -536379174926548619L, 6343722878919863216L, 1557757008211571405L, -334093799456298669L, + 619602023052756397L, 6904874397154297343L, -4332034907782234995L, + -8767842695446545180L, -6127250063205613011L, 6902212562850963795L, + 4778607575334665692L, 7674074815344809639L, -3834944692798167050L, + 7406081418831471202L, -9126886315356724563L, 8093878176633322645L, + 2471547025788214028L, -5018828829942988155L, -6676531171364391367L, + 8189793226936659851L, 7150026713387306746L, -6065566098373722052L, + 3281133763697608570L, 957103694526079944L, -3009447279791131829L, + -1995600795755716697L, 2361055030313262510L, -4312828282749171343L, + 8836216125516165138L, 5548785979447786253L, 8567551485822958810L, 5931896003625723150L, + 3472058092439106147L, 4363240277904515929L, -2999484068697753019L, + -8285358702782547958L, -2407429647076308777L, 4411565001760018584L, + 792384115860070648L, 3328145302561962294L, -2377559446421434356L, + -7837698939558960516L, -565806101451282875L, -4792610084643070650L, + 2713520205731589923L, -6521104721472605988L, 5037187811345411645L, + 3866939564433764178L, -3851229228204678079L, -8171137274242372558L, + -14713951794749384L, 2061783257002637655L, -7375571393873059570L, 7402007407273053723L, + -5104318069025846447L, -8956415532448219980L, 4904595193891993401L, + 5396360181536889307L, -8043917553767343384L, -3666269817017255250L, + -6535587792359353103L, -4553034734642385706L, -7544140164897268962L, + 2468330113904053484L, 5790319365381968237L, -2734383156062609640L, + -4831208471935595172L, 4502079643250626043L, 4778622151522470246L, + 7233054223498326990L, 5833883346008509644L, -8013495378054295093L, + 2944606201054530456L, -8608231828651976245L, -6957117814546267426L, + -4744827311133020624L, 2640030216500286789L, 8343959867315747844L) + + val strs: Array[CharSequence] = + longs.map(_.toString) + + val seqs: Array[CharSequence] = + longs.map { n => + val prefix = "x" * (n & 63).toInt + val suffix = "y" * ((n * 7) & 63).toInt + val i = prefix.length + val s = n.toString + Slice(prefix + s + suffix, i, s.length + i) + } + + val str: CharSequence = "23948271429443" + + val seq: CharSequence = Slice("weigjewigjwi23948271429443jgewigjweiwjegiwgjiewjgeiwjg", 12, 26) + + def sumJava(css: Array[CharSequence]): Long = { + var sum: Long = 0 + var i = 0 + while (i < css.length) { + sum += java.lang.Long.parseLong(css(i).toString) + i += 1 + } + sum + } + + def sumStd(css: Array[CharSequence]): Long = { + var sum: Long = 0 + var i = 0 + while (i < css.length) { + sum += css(i).toString.toLong + i += 1 + } + sum + } + + def sumSafe(css: Array[CharSequence]): Long = { + var sum: Long = 0 + var i = 0 + while (i < css.length) { + sum += util.parseLong(css(i)) + i += 1 + } + sum + } + + def sumUnsafe(css: Array[CharSequence]): Long = { + var sum: Long = 0 + var i = 0 + while (i < css.length) { + sum += util.parseLongUnsafe(css(i)) + i += 1 + } + sum + } + + @Benchmark def stringArrayJava(): Long = sumJava(strs) + @Benchmark def seqArrayJava(): Long = sumJava(seqs) + @Benchmark def stringValueJava(): Long = java.lang.Long.parseLong(str.toString) + @Benchmark def seqValueJava(): Long = java.lang.Long.parseLong(seq.toString) + + @Benchmark def stringArrayStd(): Long = sumStd(strs) + @Benchmark def seqArrayStd(): Long = sumStd(seqs) + @Benchmark def stringValueStd(): Long = str.toString.toLong + @Benchmark def seqValueStd(): Long = seq.toString.toLong + + @Benchmark def stringArraySafe(): Long = sumSafe(strs) + @Benchmark def seqArraySafe(): Long = sumSafe(seqs) + @Benchmark def stringValueSafe(): Long = util.parseLong(str) + @Benchmark def seqValueSafe(): Long = util.parseLong(seq) + + @Benchmark def stringArrayUnsafe(): Long = sumUnsafe(strs) + @Benchmark def seqArrayUnsafe(): Long = sumUnsafe(seqs) + @Benchmark def stringValueUnsafe(): Long = util.parseLongUnsafe(str) + @Benchmark def seqValueUnsafe(): Long = util.parseLongUnsafe(seq) +} diff --git a/benchmark/src/main/scala/jawn/Parboiled.scala b/benchmark/src/main/scala/jawn/Parboiled.scala deleted file mode 100644 index 541f70d8..00000000 --- a/benchmark/src/main/scala/jawn/Parboiled.scala +++ /dev/null @@ -1,105 +0,0 @@ -package org.typelevel.jawn.benchmark - -/* - * Copyright (C) 2009-2013 Mathias Doenitz, Alexander Myltsev - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import scala.annotation.switch -import org.parboiled2._ -import spray.json.{ParserInput => _, _} - -/** - * This is a feature-complete JSON parser implementation that almost directly - * models the JSON grammar presented at http://www.json.org as a parboiled2 PEG parser. - */ -class ParboiledParser(val input: ParserInput) extends Parser with StringBuilding { - import CharPredicate.{Digit, Digit19, HexDigit} - import ParboiledParser._ - - // the root rule - def Json = rule { WhiteSpace ~ Value ~ EOI } - - def JsonObject: Rule1[JsObject] = rule { - ws('{') ~ zeroOrMore(Pair).separatedBy(ws(',')) ~ ws('}') ~> ((fields: Seq[JsField]) => JsObject(fields :_*)) - } - - def Pair = rule { JsonStringUnwrapped ~ ws(':') ~ Value ~> ((_, _)) } - - def Value: Rule1[JsValue] = rule { - // as an optimization of the equivalent rule: - // JsonString | JsonNumber | JsonObject | JsonArray | JsonTrue | JsonFalse | JsonNull - // we make use of the fact that one-char lookahead is enough to discriminate the cases - run { - (cursorChar: @switch) match { - case '"' => JsonString - case '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '-' => JsonNumber - case '{' => JsonObject - case '[' => JsonArray - case 't' => JsonTrue - case 'f' => JsonFalse - case 'n' => JsonNull - case _ => MISMATCH - } - } - } - - def JsonString = rule { JsonStringUnwrapped ~> (JsString(_)) } - - def JsonStringUnwrapped = rule { '"' ~ clearSB() ~ Characters ~ ws('"') ~ push(sb.toString) } - - def JsonNumber = rule { capture(Integer ~ optional(Frac) ~ optional(Exp)) ~> (JsNumber(_)) ~ WhiteSpace } - - def JsonArray = rule { ws('[') ~ zeroOrMore(Value).separatedBy(ws(',')) ~ ws(']') ~> (JsArray(_ :_*)) } - - def Characters = rule { zeroOrMore(NormalChar | '\\' ~ EscapedChar) } - - def NormalChar = rule { !QuoteBackslash ~ ANY ~ appendSB() } - - def EscapedChar = rule ( - QuoteSlashBackSlash ~ appendSB() - | 'b' ~ appendSB('\b') - | 'f' ~ appendSB('\f') - | 'n' ~ appendSB('\n') - | 'r' ~ appendSB('\r') - | 't' ~ appendSB('\t') - | Unicode ~> { code => sb.append(code.asInstanceOf[Char]); () } - ) - - def Unicode = rule { 'u' ~ capture(HexDigit ~ HexDigit ~ HexDigit ~ HexDigit) ~> (java.lang.Integer.parseInt(_, 16)) } - - def Integer = rule { optional('-') ~ (Digit19 ~ Digits | Digit) } - - def Digits = rule { oneOrMore(Digit) } - - def Frac = rule { "." ~ Digits } - - def Exp = rule { ignoreCase('e') ~ optional(anyOf("+-")) ~ Digits } - - def JsonTrue = rule { "true" ~ WhiteSpace ~ push(JsTrue) } - - def JsonFalse = rule { "false" ~ WhiteSpace ~ push(JsFalse) } - - def JsonNull = rule { "null" ~ WhiteSpace ~ push(JsNull) } - - def WhiteSpace = rule { zeroOrMore(WhiteSpaceChar) } - - def ws(c: Char) = rule { c ~ WhiteSpace } -} - -object ParboiledParser { - val WhiteSpaceChar = CharPredicate(" \n\r\t\f") - val QuoteBackslash = CharPredicate("\"\\") - val QuoteSlashBackSlash = QuoteBackslash ++ "/" -} diff --git a/benchmark/src/main/scala/jawn/ParseLongBench.scala b/benchmark/src/main/scala/jawn/ParseLongBench.scala deleted file mode 100644 index 4e600a8a..00000000 --- a/benchmark/src/main/scala/jawn/ParseLongBench.scala +++ /dev/null @@ -1,132 +0,0 @@ -package org.typelevel.jawn -package benchmark - -import java.util.concurrent.TimeUnit - -import org.openjdk.jmh.annotations._ - -case class Slice(s: String, begin: Int, limit: Int) extends CharSequence { - val length: Int = limit - begin - def charAt(i: Int): Char = s.charAt(begin + i) - def subSequence(start: Int, end: Int): Slice = - Slice(s, begin + start, Math.min(end + begin, limit)) - override def toString: String = - s.substring(begin, limit) -} - -@State(Scope.Benchmark) -@OutputTimeUnit(TimeUnit.MILLISECONDS) -class ParseLongBench { - - val longs: Array[Long] = Array( - -1346837161442476189L, -4666345991836441070L, 4868830844043235709L, - 2992690405064579158L, -2017521011608078634L, -3039682866169364757L, - 8997687047891586260L, 5932727796276454607L, 4062739618560250554L, - 8668950167358198490L, -8565613821858118870L, 8049785848575684314L, - -580831266940599830L, -3593199367295538945L, 8374322595267797482L, - 3088261552516619129L, -6879203747403593851L, -1842900848925949857L, - 4484592876047641351L, 5182973278356955602L, -6840392853855436945L, - -4176340556015032222L, -536379174926548619L, 6343722878919863216L, - 1557757008211571405L, -334093799456298669L, 619602023052756397L, - 6904874397154297343L, -4332034907782234995L, -8767842695446545180L, - -6127250063205613011L, 6902212562850963795L, 4778607575334665692L, - 7674074815344809639L, -3834944692798167050L, 7406081418831471202L, - -9126886315356724563L, 8093878176633322645L, 2471547025788214028L, - -5018828829942988155L, -6676531171364391367L, 8189793226936659851L, - 7150026713387306746L, -6065566098373722052L, 3281133763697608570L, - 957103694526079944L, -3009447279791131829L, -1995600795755716697L, - 2361055030313262510L, -4312828282749171343L, 8836216125516165138L, - 5548785979447786253L, 8567551485822958810L, 5931896003625723150L, - 3472058092439106147L, 4363240277904515929L, -2999484068697753019L, - -8285358702782547958L, -2407429647076308777L, 4411565001760018584L, - 792384115860070648L, 3328145302561962294L, -2377559446421434356L, - -7837698939558960516L, -565806101451282875L, -4792610084643070650L, - 2713520205731589923L, -6521104721472605988L, 5037187811345411645L, - 3866939564433764178L, -3851229228204678079L, -8171137274242372558L, - -14713951794749384L, 2061783257002637655L, -7375571393873059570L, - 7402007407273053723L, -5104318069025846447L, -8956415532448219980L, - 4904595193891993401L, 5396360181536889307L, -8043917553767343384L, - -3666269817017255250L, -6535587792359353103L, -4553034734642385706L, - -7544140164897268962L, 2468330113904053484L, 5790319365381968237L, - -2734383156062609640L, -4831208471935595172L, 4502079643250626043L, - 4778622151522470246L, 7233054223498326990L, 5833883346008509644L, - -8013495378054295093L, 2944606201054530456L, -8608231828651976245L, - -6957117814546267426L, -4744827311133020624L, 2640030216500286789L, - 8343959867315747844L) - - val strs: Array[CharSequence] = - longs.map(_.toString) - - val seqs: Array[CharSequence] = - longs.map { n => - val prefix = "x" * (n & 63).toInt - val suffix = "y" * ((n * 7) & 63).toInt - val i = prefix.length - val s = n.toString - Slice(prefix + s + suffix, i, s.length + i) - } - - val str: CharSequence = "23948271429443" - - val seq: CharSequence = Slice("weigjewigjwi23948271429443jgewigjweiwjegiwgjiewjgeiwjg", 12, 26) - - def sumJava(css: Array[CharSequence]): Long = { - var sum: Long = 0 - var i = 0 - while (i < css.length) { - sum += java.lang.Long.parseLong(css(i).toString) - i += 1 - } - sum - } - - def sumStd(css: Array[CharSequence]): Long = { - var sum: Long = 0 - var i = 0 - while (i < css.length) { - sum += css(i).toString.toLong - i += 1 - } - sum - } - - def sumSafe(css: Array[CharSequence]): Long = { - var sum: Long = 0 - var i = 0 - while (i < css.length) { - sum += util.parseLong(css(i)) - i += 1 - } - sum - } - - def sumUnsafe(css: Array[CharSequence]): Long = { - var sum: Long = 0 - var i = 0 - while (i < css.length) { - sum += util.parseLongUnsafe(css(i)) - i += 1 - } - sum - } - - @Benchmark def stringArrayJava(): Long = sumJava(strs) - @Benchmark def seqArrayJava(): Long = sumJava(seqs) - @Benchmark def stringValueJava(): Long = java.lang.Long.parseLong(str.toString) - @Benchmark def seqValueJava(): Long = java.lang.Long.parseLong(seq.toString) - - @Benchmark def stringArrayStd(): Long = sumStd(strs) - @Benchmark def seqArrayStd(): Long = sumStd(seqs) - @Benchmark def stringValueStd(): Long = str.toString.toLong - @Benchmark def seqValueStd(): Long = seq.toString.toLong - - @Benchmark def stringArraySafe(): Long = sumSafe(strs) - @Benchmark def seqArraySafe(): Long = sumSafe(seqs) - @Benchmark def stringValueSafe(): Long = util.parseLong(str) - @Benchmark def seqValueSafe(): Long = util.parseLong(seq) - - @Benchmark def stringArrayUnsafe(): Long = sumUnsafe(strs) - @Benchmark def seqArrayUnsafe(): Long = sumUnsafe(seqs) - @Benchmark def stringValueUnsafe(): Long = util.parseLongUnsafe(str) - @Benchmark def seqValueUnsafe(): Long = util.parseLongUnsafe(seq) -} diff --git a/build.sbt b/build.sbt index 7094cf75..22c0849e 100644 --- a/build.sbt +++ b/build.sbt @@ -1,77 +1,29 @@ -import ReleaseTransformations._ - -lazy val previousJawnVersion = "1.1.2" - +ThisBuild / tlBaseVersion := "1.3" lazy val scala212 = "2.12.15" lazy val scala213 = "2.13.6" lazy val scala3 = "3.0.2" -ThisBuild / scalaVersion := scala212 -ThisBuild / organization := "org.typelevel" -ThisBuild / licenses += ("MIT", url("http://opensource.org/licenses/MIT")) -ThisBuild / homepage := Some(url("http://github.com/typelevel/jawn")) -ThisBuild / versionScheme := Some("early-semver") -ThisBuild / scmInfo := Some( - ScmInfo( - browseUrl = url("https://github.com/typelevel/jawn"), - connection = "scm:git:git@github.com:typelevel/jawn.git" - ) -) - +ThisBuild / crossScalaVersions := Seq(scala3, scala213, scala212) +ThisBuild / tlVersionIntroduced := Map("3" -> "1.1.2") +ThisBuild / startYear := Some(2012) +ThisBuild / licenses := Seq("MIT" -> url("http://opensource.org/licenses/MIT")) ThisBuild / developers += Developer( name = "Erik Osheim", email = "erik@plastic-idolatry.com", id = "d_m", url = url("http://github.com/non/") ) - -lazy val benchmarkVersion = - scala212 +ThisBuild / githubWorkflowBuildMatrixExclusions += + MatrixExclude(Map("scala" -> scala3, "project" -> "rootNative")) +ThisBuild / tlFatalWarningsInCi := false lazy val jawnSettings = Seq( - crossScalaVersions := Seq(scala212, scala213, scala3), - mimaPreviousArtifacts := Set(organization.value %% moduleName.value % previousJawnVersion), - resolvers += Resolver.sonatypeRepo("releases"), Test / testOptions += Tests.Argument(TestFrameworks.ScalaCheck, "-verbosity", "1"), - libraryDependencies += "org.scalacheck" %%% "scalacheck" % "1.15.4" % Test, - scalacOptions ++= - "-deprecation" :: - "-encoding" :: "utf-8" :: - "-feature" :: - "-unchecked" :: - "-Xlint" :: - "-opt:l:method" :: - Nil, - // release stuff - releaseCrossBuild := true, - releaseVcsSign := true, - publishMavenStyle := true, - Test / publishArtifact := false, - pomIncludeRepository := Function.const(false), - publishTo := { - val nexus = "https://oss.sonatype.org/" - if (isSnapshot.value) - Some("Snapshots".at(nexus + "content/repositories/snapshots")) - else - Some("Releases".at(nexus + "service/local/staging/deploy/maven2")) - }, - releaseProcess := Seq[ReleaseStep]( - checkSnapshotDependencies, - inquireVersions, - runClean, - releaseStepCommandAndRemaining("+test"), // formerly runTest - setReleaseVersion, - commitReleaseVersion, - tagRelease, - releaseStepCommandAndRemaining("+publishSigned"), - setNextVersion, - commitNextVersion, - releaseStepCommandAndRemaining("sonatypeReleaseAll"), - pushChanges - ) + libraryDependencies += "org.scalacheck" %%% "scalacheck" % "1.15.4" % Test ) lazy val jawnSettingsJVM = List(Test / fork := true) lazy val jawnSettingsJS = List( + tlVersionIntroduced := List("2.12", "2.13", "3").map(_ -> "1.2.0").toMap, scalaJSLinkerConfig ~= { _.withSemantics( _.withAsInstanceOfs(org.scalajs.linker.interface.CheckedBehavior.Unchecked) @@ -80,22 +32,12 @@ lazy val jawnSettingsJS = List( } ) lazy val jawnSettingsNative = Seq( - crossScalaVersions := crossScalaVersions.value.filterNot(ScalaArtifacts.isScala3) + tlVersionIntroduced := List("2.12", "2.13", "3").map(_ -> "1.3.0").toMap, + crossScalaVersions := List(scala212, scala213) ) -lazy val jawnSettingsJSNative = Seq( - mimaPreviousArtifacts := Set() -) - -lazy val noPublish = Seq(publish / skip := true, mimaPreviousArtifacts := Set()) -lazy val root = project - .in(file(".")) - .aggregate(all.flatMap(_.componentProjects).map(Project.projectToRef): _*) - .disablePlugins(JmhPlugin) - .settings(name := "jawn") - .settings(jawnSettings: _*) - .settings(crossScalaVersions := List()) - .settings(noPublish: _*) +lazy val root = tlCrossRootProject + .aggregate(parser, util, ast, benchmark) lazy val parser = crossProject(JVMPlatform, JSPlatform, NativePlatform) .crossType(CrossType.Full) @@ -106,8 +48,6 @@ lazy val parser = crossProject(JVMPlatform, JSPlatform, NativePlatform) .jvmSettings(jawnSettingsJVM: _*) .jsSettings(jawnSettingsJS: _*) .nativeSettings(jawnSettingsNative: _*) - .platformsSettings(JSPlatform, NativePlatform)(jawnSettingsJSNative) - .disablePlugins(JmhPlugin) lazy val util = crossProject(JVMPlatform, JSPlatform, NativePlatform) .crossType(CrossType.Full) @@ -119,8 +59,6 @@ lazy val util = crossProject(JVMPlatform, JSPlatform, NativePlatform) .jvmSettings(jawnSettingsJVM: _*) .jsSettings(jawnSettingsJS: _*) .nativeSettings(jawnSettingsNative: _*) - .platformsSettings(JSPlatform, NativePlatform)(jawnSettingsJSNative) - .disablePlugins(JmhPlugin) lazy val ast = crossProject(JVMPlatform, JSPlatform, NativePlatform) .crossType(CrossType.Full) @@ -133,18 +71,10 @@ lazy val ast = crossProject(JVMPlatform, JSPlatform, NativePlatform) .jvmSettings(jawnSettingsJVM: _*) .jsSettings(jawnSettingsJS: _*) .nativeSettings(jawnSettingsNative: _*) - .platformsSettings(JSPlatform, NativePlatform)(jawnSettingsJSNative) - .disablePlugins(JmhPlugin) lazy val benchmark = project .in(file("benchmark")) - .dependsOn(all.map(_.jvm).map(Project.classpathDependency[Project]): _*) + .dependsOn(parser.jvm, util.jvm, ast.jvm) .settings(name := "jawn-benchmark") .settings(jawnSettings: _*) - .settings(scalaVersion := benchmarkVersion) - .settings(crossScalaVersions := Seq(benchmarkVersion)) - .settings(noPublish: _*) - .enablePlugins(JmhPlugin) - -lazy val all = - Seq(parser, util, ast) + .enablePlugins(NoPublishPlugin, JmhPlugin) diff --git a/parser/js/src/main/scala/jawn/ParserCompanionPlatform.scala b/parser/js/src/main/scala/jawn/ParserCompanionPlatform.scala index 89ebbbf3..3f48ed7e 100644 --- a/parser/js/src/main/scala/jawn/ParserCompanionPlatform.scala +++ b/parser/js/src/main/scala/jawn/ParserCompanionPlatform.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn private[jawn] trait ParserCompanionPlatform diff --git a/parser/js/src/main/scala/jawn/SupportParser.scala b/parser/js/src/main/scala/jawn/SupportParser.scala index ef463cf2..46f7b36f 100644 --- a/parser/js/src/main/scala/jawn/SupportParser.scala +++ b/parser/js/src/main/scala/jawn/SupportParser.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn import java.nio.ByteBuffer diff --git a/parser/js/src/main/scala/jawn/SyntaxPlatform.scala b/parser/js/src/main/scala/jawn/SyntaxPlatform.scala index edea8e79..f7c7718e 100644 --- a/parser/js/src/main/scala/jawn/SyntaxPlatform.scala +++ b/parser/js/src/main/scala/jawn/SyntaxPlatform.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn private[jawn] trait SyntaxPlatform diff --git a/parser/js/src/test/scala/jawn/JNumIndexCheckPlatform.scala b/parser/js/src/test/scala/jawn/JNumIndexCheckPlatform.scala index ae863d1b..7ed595e9 100644 --- a/parser/js/src/test/scala/jawn/JNumIndexCheckPlatform.scala +++ b/parser/js/src/test/scala/jawn/JNumIndexCheckPlatform.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn package parser diff --git a/parser/js/src/test/scala/jawn/SyntaxCheckPlatform.scala b/parser/js/src/test/scala/jawn/SyntaxCheckPlatform.scala index 4c78a83d..2de570fa 100644 --- a/parser/js/src/test/scala/jawn/SyntaxCheckPlatform.scala +++ b/parser/js/src/test/scala/jawn/SyntaxCheckPlatform.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn package parser diff --git a/parser/jvm/src/main/scala/jawn/ChannelParser.scala b/parser/jvm/src/main/scala/jawn/ChannelParser.scala index 33a1ed54..62b2b269 100644 --- a/parser/jvm/src/main/scala/jawn/ChannelParser.scala +++ b/parser/jvm/src/main/scala/jawn/ChannelParser.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn import java.lang.Integer.{bitCount, highestOneBit} diff --git a/parser/jvm/src/main/scala/jawn/ParserCompanionPlatform.scala b/parser/jvm/src/main/scala/jawn/ParserCompanionPlatform.scala index 699fad12..36c0cbd0 100644 --- a/parser/jvm/src/main/scala/jawn/ParserCompanionPlatform.scala +++ b/parser/jvm/src/main/scala/jawn/ParserCompanionPlatform.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn import java.io.File diff --git a/parser/jvm/src/main/scala/jawn/SupportParser.scala b/parser/jvm/src/main/scala/jawn/SupportParser.scala index 03088df4..ca609422 100644 --- a/parser/jvm/src/main/scala/jawn/SupportParser.scala +++ b/parser/jvm/src/main/scala/jawn/SupportParser.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn import java.io.File diff --git a/parser/jvm/src/main/scala/jawn/SyntaxPlatform.scala b/parser/jvm/src/main/scala/jawn/SyntaxPlatform.scala index 82157bab..5eabc1f3 100644 --- a/parser/jvm/src/main/scala/jawn/SyntaxPlatform.scala +++ b/parser/jvm/src/main/scala/jawn/SyntaxPlatform.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn import java.io.File diff --git a/parser/jvm/src/test/scala/jawn/ChannelSpec.scala b/parser/jvm/src/test/scala/jawn/ChannelSpec.scala index e654e743..eb6a9179 100644 --- a/parser/jvm/src/test/scala/jawn/ChannelSpec.scala +++ b/parser/jvm/src/test/scala/jawn/ChannelSpec.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn package parser diff --git a/parser/jvm/src/test/scala/jawn/JNumIndexCheckPlatform.scala b/parser/jvm/src/test/scala/jawn/JNumIndexCheckPlatform.scala index 11570ee2..40e2a579 100644 --- a/parser/jvm/src/test/scala/jawn/JNumIndexCheckPlatform.scala +++ b/parser/jvm/src/test/scala/jawn/JNumIndexCheckPlatform.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn package parser diff --git a/parser/jvm/src/test/scala/jawn/SyntaxCheckPlatform.scala b/parser/jvm/src/test/scala/jawn/SyntaxCheckPlatform.scala index e40eb1e3..3c634671 100644 --- a/parser/jvm/src/test/scala/jawn/SyntaxCheckPlatform.scala +++ b/parser/jvm/src/test/scala/jawn/SyntaxCheckPlatform.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn package parser diff --git a/parser/native/src/main/scala/jawn/ParserCompanionPlatform.scala b/parser/native/src/main/scala/jawn/ParserCompanionPlatform.scala index 89ebbbf3..3f48ed7e 100644 --- a/parser/native/src/main/scala/jawn/ParserCompanionPlatform.scala +++ b/parser/native/src/main/scala/jawn/ParserCompanionPlatform.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn private[jawn] trait ParserCompanionPlatform diff --git a/parser/native/src/main/scala/jawn/SupportParser.scala b/parser/native/src/main/scala/jawn/SupportParser.scala index ef463cf2..46f7b36f 100644 --- a/parser/native/src/main/scala/jawn/SupportParser.scala +++ b/parser/native/src/main/scala/jawn/SupportParser.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn import java.nio.ByteBuffer diff --git a/parser/native/src/main/scala/jawn/SyntaxPlatform.scala b/parser/native/src/main/scala/jawn/SyntaxPlatform.scala index edea8e79..f7c7718e 100644 --- a/parser/native/src/main/scala/jawn/SyntaxPlatform.scala +++ b/parser/native/src/main/scala/jawn/SyntaxPlatform.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn private[jawn] trait SyntaxPlatform diff --git a/parser/native/src/test/scala/jawn/JNumIndexCheckPlatform.scala b/parser/native/src/test/scala/jawn/JNumIndexCheckPlatform.scala index ae863d1b..7ed595e9 100644 --- a/parser/native/src/test/scala/jawn/JNumIndexCheckPlatform.scala +++ b/parser/native/src/test/scala/jawn/JNumIndexCheckPlatform.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn package parser diff --git a/parser/native/src/test/scala/jawn/SyntaxCheckPlatform.scala b/parser/native/src/test/scala/jawn/SyntaxCheckPlatform.scala index 4c78a83d..2de570fa 100644 --- a/parser/native/src/test/scala/jawn/SyntaxCheckPlatform.scala +++ b/parser/native/src/test/scala/jawn/SyntaxCheckPlatform.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn package parser diff --git a/parser/shared/src/main/scala/jawn/AsyncParser.scala b/parser/shared/src/main/scala/jawn/AsyncParser.scala index 3e6b5ca4..a46b9e4d 100644 --- a/parser/shared/src/main/scala/jawn/AsyncParser.scala +++ b/parser/shared/src/main/scala/jawn/AsyncParser.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn import scala.annotation.switch diff --git a/parser/shared/src/main/scala/jawn/ByteArrayParser.scala b/parser/shared/src/main/scala/jawn/ByteArrayParser.scala index b2063ac0..0c47660b 100644 --- a/parser/shared/src/main/scala/jawn/ByteArrayParser.scala +++ b/parser/shared/src/main/scala/jawn/ByteArrayParser.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn /** diff --git a/parser/shared/src/main/scala/jawn/ByteBasedParser.scala b/parser/shared/src/main/scala/jawn/ByteBasedParser.scala index 9bb4e690..0fd48938 100644 --- a/parser/shared/src/main/scala/jawn/ByteBasedParser.scala +++ b/parser/shared/src/main/scala/jawn/ByteBasedParser.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn import scala.annotation.switch diff --git a/parser/shared/src/main/scala/jawn/ByteBufferParser.scala b/parser/shared/src/main/scala/jawn/ByteBufferParser.scala index e99a2753..1bf02cb2 100644 --- a/parser/shared/src/main/scala/jawn/ByteBufferParser.scala +++ b/parser/shared/src/main/scala/jawn/ByteBufferParser.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn import java.nio.{Buffer, ByteBuffer} diff --git a/parser/shared/src/main/scala/jawn/CharBasedParser.scala b/parser/shared/src/main/scala/jawn/CharBasedParser.scala index 755eb305..584cde55 100644 --- a/parser/shared/src/main/scala/jawn/CharBasedParser.scala +++ b/parser/shared/src/main/scala/jawn/CharBasedParser.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn import scala.annotation.switch diff --git a/parser/shared/src/main/scala/jawn/CharSequenceParser.scala b/parser/shared/src/main/scala/jawn/CharSequenceParser.scala index b977de76..cf31e06d 100644 --- a/parser/shared/src/main/scala/jawn/CharSequenceParser.scala +++ b/parser/shared/src/main/scala/jawn/CharSequenceParser.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn /** diff --git a/parser/shared/src/main/scala/jawn/FContext.scala b/parser/shared/src/main/scala/jawn/FContext.scala index 15831f37..752f06c3 100644 --- a/parser/shared/src/main/scala/jawn/FContext.scala +++ b/parser/shared/src/main/scala/jawn/FContext.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn /** diff --git a/parser/shared/src/main/scala/jawn/Facade.scala b/parser/shared/src/main/scala/jawn/Facade.scala index 86921f0b..574eed4e 100644 --- a/parser/shared/src/main/scala/jawn/Facade.scala +++ b/parser/shared/src/main/scala/jawn/Facade.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn import scala.collection.mutable diff --git a/parser/shared/src/main/scala/jawn/Parser.scala b/parser/shared/src/main/scala/jawn/Parser.scala index e11c4ba0..5ef5d0ba 100644 --- a/parser/shared/src/main/scala/jawn/Parser.scala +++ b/parser/shared/src/main/scala/jawn/Parser.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn import java.nio.ByteBuffer diff --git a/parser/shared/src/main/scala/jawn/StringParser.scala b/parser/shared/src/main/scala/jawn/StringParser.scala index fec39d8b..748fd88d 100644 --- a/parser/shared/src/main/scala/jawn/StringParser.scala +++ b/parser/shared/src/main/scala/jawn/StringParser.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn /** diff --git a/parser/shared/src/main/scala/jawn/SyncParser.scala b/parser/shared/src/main/scala/jawn/SyncParser.scala index 725e370c..bdb3bc14 100644 --- a/parser/shared/src/main/scala/jawn/SyncParser.scala +++ b/parser/shared/src/main/scala/jawn/SyncParser.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn import scala.annotation.switch diff --git a/parser/shared/src/main/scala/jawn/Syntax.scala b/parser/shared/src/main/scala/jawn/Syntax.scala index 6a80c6e9..58bd5e01 100644 --- a/parser/shared/src/main/scala/jawn/Syntax.scala +++ b/parser/shared/src/main/scala/jawn/Syntax.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn import java.nio.ByteBuffer diff --git a/parser/shared/src/test/scala/jawn/JNumIndexCheck.scala b/parser/shared/src/test/scala/jawn/JNumIndexCheck.scala index 2e88b8e7..6a4716ac 100644 --- a/parser/shared/src/test/scala/jawn/JNumIndexCheck.scala +++ b/parser/shared/src/test/scala/jawn/JNumIndexCheck.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn package parser diff --git a/parser/shared/src/test/scala/jawn/SyntaxCheck.scala b/parser/shared/src/test/scala/jawn/SyntaxCheck.scala index d6ac7009..d22479e0 100644 --- a/parser/shared/src/test/scala/jawn/SyntaxCheck.scala +++ b/parser/shared/src/test/scala/jawn/SyntaxCheck.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn package parser diff --git a/parser/shared/src/test/scala/jawn/TestUtil.scala b/parser/shared/src/test/scala/jawn/TestUtil.scala index 5b8e4005..43034d4b 100644 --- a/parser/shared/src/test/scala/jawn/TestUtil.scala +++ b/parser/shared/src/test/scala/jawn/TestUtil.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn package parser diff --git a/project/plugins.sbt b/project/plugins.sbt index 27334a4c..c358a636 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,10 +1,5 @@ +addSbtPlugin("org.typelevel" % "sbt-typelevel" % "0.4.0-M4") addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.3") -addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.0.1") -addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2") -addSbtPlugin("com.github.sbt" % "sbt-release" % "1.1.0") -addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6") -addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.10") -addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.1.0") addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.7.1") addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.1.0") addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.2") diff --git a/util/js/src/test/scala/jawn/util/SliceCheckPlatform.scala b/util/js/src/test/scala/jawn/util/SliceCheckPlatform.scala index 22a1fc76..a270192c 100644 --- a/util/js/src/test/scala/jawn/util/SliceCheckPlatform.scala +++ b/util/js/src/test/scala/jawn/util/SliceCheckPlatform.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn package util diff --git a/util/jvm/src/test/scala/jawn/util/SliceCheckPlatform.scala b/util/jvm/src/test/scala/jawn/util/SliceCheckPlatform.scala index 9bbf2fc8..c58192e1 100644 --- a/util/jvm/src/test/scala/jawn/util/SliceCheckPlatform.scala +++ b/util/jvm/src/test/scala/jawn/util/SliceCheckPlatform.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn package util diff --git a/util/native/src/test/scala/jawn/util/SliceCheckPlatform.scala b/util/native/src/test/scala/jawn/util/SliceCheckPlatform.scala index 22a1fc76..a270192c 100644 --- a/util/native/src/test/scala/jawn/util/SliceCheckPlatform.scala +++ b/util/native/src/test/scala/jawn/util/SliceCheckPlatform.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn package util diff --git a/util/shared/src/main/scala/jawn/util/InvalidLong.scala b/util/shared/src/main/scala/jawn/util/InvalidLong.scala index 17b9b1cb..fef5896d 100644 --- a/util/shared/src/main/scala/jawn/util/InvalidLong.scala +++ b/util/shared/src/main/scala/jawn/util/InvalidLong.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn.util class InvalidLong(s: String) extends NumberFormatException(s"For input string '$s'") diff --git a/util/shared/src/main/scala/jawn/util/Slice.scala b/util/shared/src/main/scala/jawn/util/Slice.scala index 6a8e17df..f7d3d677 100644 --- a/util/shared/src/main/scala/jawn/util/Slice.scala +++ b/util/shared/src/main/scala/jawn/util/Slice.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn.util /** diff --git a/util/shared/src/main/scala/jawn/util/package.scala b/util/shared/src/main/scala/jawn/util/package.scala index ed6ac0d4..8bb2deb1 100644 --- a/util/shared/src/main/scala/jawn/util/package.scala +++ b/util/shared/src/main/scala/jawn/util/package.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn package object util { diff --git a/util/shared/src/test/scala/jawn/util/ParseLongCheck.scala b/util/shared/src/test/scala/jawn/util/ParseLongCheck.scala index 47af737e..d334a06f 100644 --- a/util/shared/src/test/scala/jawn/util/ParseLongCheck.scala +++ b/util/shared/src/test/scala/jawn/util/ParseLongCheck.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn package util diff --git a/util/shared/src/test/scala/jawn/util/SliceCheck.scala b/util/shared/src/test/scala/jawn/util/SliceCheck.scala index 6c14e801..f2a96138 100644 --- a/util/shared/src/test/scala/jawn/util/SliceCheck.scala +++ b/util/shared/src/test/scala/jawn/util/SliceCheck.scala @@ -1,3 +1,24 @@ +/* + * Copyright (c) 2012 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + package org.typelevel.jawn package util diff --git a/version.sbt b/version.sbt deleted file mode 100644 index 825300c3..00000000 --- a/version.sbt +++ /dev/null @@ -1 +0,0 @@ -ThisBuild / version := "1.3.3-SNAPSHOT"