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

Add ShExC #2001

Closed
wants to merge 1 commit into from
Closed

Add ShExC #2001

wants to merge 1 commit into from

Conversation

ericprud
Copy link
Contributor

@ericprud ericprud commented Mar 5, 2019

This module was partially transliterated from the grammar for ShExC, ensuring completeness of the terminals and resulting in a validating highlight module.

~ factor shapeExpression

+ nesting

~ refactor and comment

+ markup test

chore(package): update del to version 4.0.0

chore(package): update lockfile package-lock.json

+ based lexer on ShExC grammar terminals.

Revert "Merge pull request #1 from highlightjs/master"

This reverts commit 06463a5, reversing
changes made to 9cf8120.
@ericprud
Copy link
Contributor Author

ericprud commented Mar 6, 2019

Something in the browser production chain is allergic to const and let so I changed everything to var. I propose adding a line to that effect in language-contribution §1 and add a §3½ with

node tools/build.js -t node && npx mocha --globals document test
node tools/build.js && npx mocha --globals document test/browser

so folks don't have to work it out from travis.yml.

While debugging the const and let issue, I created a tiny language to get module authors started:

	new file:   src/languages/_template.js
	new file:   test/detect/_template/default.txt
	new file:   test/markup/_template/_template-written.expect.txt
	new file:   test/markup/_template/_template-written.txt
	new file:   test/markup/_template/_template-read.expect.txt
	new file:   test/markup/_template/_template-read.txt

I made sure it wouldn't conflict with any other languages (relevance 0 except on a distinctive keyword) but maybe it would be better as a tarball under /docs than as a language choice the pops up in everyone's face? Anyways, yours if you think it will be useful.

@ericprud
Copy link
Contributor Author

This has migrated to https://github.com/highlightjs/highlightjs-shexc but I'm not sure how to set up automagic build tests (i.e. produces expected markup, appropriate priorities). This was automatic on PRs in the monolithic highlightjs.

Also, where do additions to docs/css-classes-reference.rst go now? In particular, how to I add the suffixes shex and shx?

@marcoscaceres
Copy link
Contributor

@ericprud true about the testing. We need to figure out a solution for that. I set up my own thing for a different project:

https://github.com/w3c/respec-hljs/blob/hljs/spec/highlight-spec.js

@ericprud
Copy link
Contributor Author

It seems like the most important test is the epic hljs.highlightAuto() test. If someone screws up their own module, so be it, but you don't want them to have inappropriate priorities which steal auto from others. I noticed that languages with URLs are prone to that (had to turn mine down to 0). Feel free to prototype some sort of prospective shared .travis.yml in https://github.com/highlightjs/highlightjs-shexc. I'm trying to make it a model highlight module and was planning on writing module authoring instructions for grammar geeks (i.e. using contents to create a sort of context-sensitive grammar, like a BNF but with no order on the components in the production).

So what's the next step now that I populated the shexc repo?

@joshgoebel joshgoebel changed the title add support for ShExC Add ShExC Oct 24, 2019
@ericprud
Copy link
Contributor Author

/me politely pestering

@joshgoebel
Copy link
Member

I’ve only just begin to look into this now that the new build system is coming along. Nothing to report yet though.

@joshgoebel
Copy link
Member

Something in the browser production chain is allergic to const and let so I changed everything to var.

@ericprud The new build process fixes this for good.

@joshgoebel
Copy link
Member

@ericprud Perhaps of interest:

#2328

@joshgoebel
Copy link
Member

Since you're actively working on your grammar and you're already listed in the README I'm going to go ahead and close out this PR.

@joshgoebel joshgoebel closed this Dec 24, 2019
@ericprud ericprud deleted the add-shexc branch December 24, 2019 10:09
@ericprud ericprud restored the add-shexc branch December 24, 2019 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants