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

SAS Language improvements #1954

Closed
cedporter opened this issue Jun 28, 2019 · 2 comments
Closed

SAS Language improvements #1954

cedporter opened this issue Jun 28, 2019 · 2 comments

Comments

@cedporter
Copy link
Contributor

Information

  • Language: SAS

Description
I'd like to make some substantial improvements to the SAS language support. I've got a draft commit ready, but I'm having trouble with the "rest:" option. I can always leave it out for now, but if someone could give me some help here, I hope to get that working, add a test for it, and get a pull request in for the changes I've made.

Code snippet

My intention here is to capture "PROC SQL;" followed by any text up to and including the next "PROC \w", "QUIT", "RUN" or "DATA". The code that follows is what I have thus far. It does capture the text as expected, but it does not apply SQL syntax highlighting to the text after the "step".
	 'procSQL': {
	 	pattern: /(^|\n)(?:proc\s+sql);[\s\S]+?(?:\r?\n|\r)(?:proc\s\w+|quit|run|data(?!\=));/im,
	 	alias: 'string',
	 	inside: {
			'step': {
				pattern: /(^|\n)(?:proc\s+sql)/i,
				alias: 'keyword'
			},
	 		rest: Prism.languages.sql
	// 	}
	 },
@RunDevelopment
Copy link
Member

@cedporter The problem isn't rest but Prism.languages.sql. Prism always tries to load as few languages as possible, so Prism.languages.sql is simply undefined.
You need to add a dependency for SQL in components.json using require (similar to how SASS requires CSS below). This should solve your problem.

@RunDevelopment
Copy link
Member

#1981 is merged already.

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

No branches or pull requests

2 participants