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

Tokenizer makes negative lookbehind regex invalid #4329

Closed
towc opened this issue Jun 29, 2020 · 1 comment
Closed

Tokenizer makes negative lookbehind regex invalid #4329

towc opened this issue Jun 29, 2020 · 1 comment

Comments

@towc
Copy link

towc commented Jun 29, 2020

changing the keywordMapper rule from [a-zA-Z_][a-zA-Z0-9_$]*\\b to (?<!\\s*\\.)([a-zA-Z_][a-zA-Z0-9_$]*)(?!\\s*\\.) in the pgSQL mode in https://ace.c9.io/tool/mode_creator.html tells you that the compiled regex is invalid, in chrome.

The (?<!\\s*\\.) is being transformed into (?:?<!\\s*\\.)

What I'm trying to achieve is to not get the second select in select xyz.select from s3.xyz" highlighted as a keyword, while maintaining s3as an identifier, rather than being split into an identifiersand numerical constant3`.

For now, I think I'll patch the tokenizer locally, to not mangle the lookbehind

@towc
Copy link
Author

towc commented Jun 29, 2020

It seems all that's needed is to replace [:=!] with [:=!<] in https://github.com/ajaxorg/ace/blob/master/lib/ace/tokenizer.js#L179

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

No branches or pull requests

2 participants