Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Scala keywords to support Scala 3 #3506

Merged
merged 3 commits into from
Jul 26, 2022

Conversation

julienrf
Copy link
Contributor

@julienrf julienrf commented Jul 26, 2022

Add several soft keywords that have been introduced in Scala 3.

@github-actions
Copy link

github-actions bot commented Jul 26, 2022

JS File Size Changes (gzipped)

A total of 1 files have changed, with a combined diff of +38 B (+5.7%).

file master pull size diff % diff
components/prism-scala.min.js 665 B 703 B +38 B +5.7%

Generated by 🚫 dangerJS against 5cbaaba

Copy link
Member

@RunDevelopment RunDevelopment left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR!

Please add the new keywords to Scala's keyword test and update the test. And please rebuild Prism by running npm ci && npm run build (the prism-scala.min.js file needs to be committed).

@julienrf
Copy link
Contributor Author

Thank you @RunDevelopment for your help. I’ve added a test but I was unable to update the test:

$ npm run test:languages -- --update

> prismjs@1.28.0 test:languages /tmp/prism
> mocha tests/run.js "--update"

<function>:7
      return await import(url.pathToFileURL(file));
                   ^

SyntaxError: Expected an operand but found import
    at Module._compile (internal/modules/cjs/loader.js:891:18)
    at Object.<anonymous> (internal/modules/cjs/loader.js:991:10)
    at Module.load (internal/modules/cjs/loader.js:811:32)
    at Function._load (internal/modules/cjs/loader.js:723:14)
    at Module.require (internal/modules/cjs/loader.js:848:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/tmp/prism/node_modules/mocha/lib/mocha.js:16:16)
    at Module._compile (internal/modules/cjs/loader.js:955:30)
    at Object.<anonymous> (internal/modules/cjs/loader.js:991:10)
    at Module.load (internal/modules/cjs/loader.js:811:32)

Maybe my version of node is too old? I use version 14.20.0, which should be OK according to your README?

Running npm run build failed as well:

$ npm run build                     

> prismjs@1.28.0 build /tmp/prism
> gulp

no native wasm support detected
no binaryen method succeeded. consider enabling more options, like interpreting, if you want that: https://github.com/kripken/emscripten/wiki/WebAssembly#binaryen-methods
no binaryen method succeeded. consider enabling more options, like interpreting, if you want that: https://github.com/kripken/emscripten/wiki/WebAssembly#binaryen-methods

/tmp/prism/node_modules/wawoff2/build/woff2/compress_binding.js:1
(function (exports, require, module, __filename, __dirname) {var Module=typeof Module!=="undefined"?Module:{};var Module={"locateFile":(function(filename){return __dirname+"/"+filename})};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;if(Module["ENVIRONMENT"]){if(Module["ENVIRONMENT"]==="WEB"){ENVIRONMENT_IS_WEB=true}else if(Module["ENVIRONMENT"]==="WORKER"){ENVIRONMENT_IS_WORKER=true}else if(Module["ENVIRONMENT"]==="NODE"){ENVIRONMENT_IS_NODE=true}else if(Module["ENVIRONMENT"]==="SHELL"){ENVIRONMENT_IS_SHELL=true}else{throw new Error("The provided Module['ENVIRONMENT'] value is not valid. It must be one of: WEB|WORKER|NODE|SHELL.")}}else{ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE
abort("no binaryen method succeeded. consider enabling more options, like interpreting, if you want that: https://github.com/kripken/emscripten/wiki/WebAssembly#binaryen-methods"). Build with -s ASSERTIONS=1 for more info.

I am not sure how to move forward.

Add `given`, `transparent`, and `using` keywords.
@RunDevelopment
Copy link
Member

RunDevelopment commented Jul 26, 2022

No, NodeJS v14.x is supported. We use that version is our CI.

Are you sure you installed our dependencies correctly? Please use npm ci.

@julienrf
Copy link
Contributor Author

I did rm -rf node_modules and then npm ci. Then npm run test:languages -- --update failed the same way.

@RunDevelopment
Copy link
Member

That is very strange. My only guess is that npm is not actually using node to run our tests and build scripts. We recently had a similar issue.

For now, I rebuilt and updated the tests for you.

@RunDevelopment RunDevelopment merged commit a090d06 into PrismJS:master Jul 26, 2022
@julienrf julienrf deleted the patch-1 branch July 26, 2022 18:52
@julienrf
Copy link
Contributor Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants