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

Fix builtins missing keywords issue in Matlab #2007

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tancnle
Copy link
Collaborator

@tancnle tancnle commented Oct 26, 2023

Rendering MATLAB code on Rouge (https://rouge.jneen.net/v4.2.0/matlab/) causes exception.

2023-10-26T23:54:09Z app[e2865659b14968] lax [info]2023-10-26 23:54:09 - NameError - uninitialized constant Rouge::Lexers::Matlab:
2023-10-26T23:54:09Z app[e2865659b14968] lax [info]     /app/tmp/rouge/rouge-4.2.0/lib/rouge/lexers/matlab/keywords.rb:11:in `<module:Lexers>'
2023-10-26T23:54:09Z app[e2865659b14968] lax [info]     /app/tmp/rouge/rouge-4.2.0/lib/rouge/lexers/matlab/keywords.rb:10:in `<module:Rouge>'
2023-10-26T23:54:09Z app[e2865659b14968] lax [info]     /app/tmp/rouge/rouge-4.2.0/lib/rouge/lexers/matlab/keywords.rb:9:in `<top (required)>'
2023-10-26T23:54:09Z app[e2865659b14968] lax [info]     /app/tmp/rouge/rouge-4.2.0/lib/rouge/lexers/matlab.rb:24:in `load'
2023-10-26T23:54:09Z app[e2865659b14968] lax [info]     /app/tmp/rouge/rouge-4.2.0/lib/rouge/lexers/matlab.rb:24:in `builtins'
2023-10-26T23:54:09Z app[e2865659b14968] lax [info]     /app/tmp/rouge/rouge-4.2.0/lib/rouge/lexers/matlab.rb:46:in `block (2 levels) in <class:Matlab>'
2023-10-26T23:54:09Z app[e2865659b14968] lax [info]     /app/tmp/rouge/rouge-4.2.0/lib/rouge/regex_lexer.rb:364:in `instance_exec'
2023-10-26T23:54:09Z app[e2865659b14968] lax [info]     /app/tmp/rouge/rouge-4.2.0/lib/rouge/regex_lexer.rb:364:in `block in step'
2023-10-26T23:54:09Z app[e2865659b14968] lax [info]     /app/tmp/rouge/rouge-4.2.0/lib/rouge/regex_lexer.rb:346:in `each'
2023-10-26T23:54:09Z app[e2865659b14968] lax [info]     /app/tmp/rouge/rouge-4.2.0/lib/rouge/regex_lexer.rb:346:in `step'
2023-10-26T23:54:09Z app[e2865659b14968] lax [info]     /app/tmp/rouge/rouge-4.2.0/lib/rouge/regex_lexer.rb:327:in `stream_tokens'
2023-10-26T23:54:09Z app[e2865659b14968] lax [info]     /app/tmp/rouge/rouge-4.2.0/lib/rouge/lexer.rb:480:in `continue_lex'
2023-10-26T23:54:09Z app[e2865659b14968] lax [info]     /app/tmp/rouge/rouge-4.2.0/lib/rouge/lexer.rb:470:in `lex'
2023-10-26T23:54:09Z app[e2865659b14968] lax [info]     /app/tmp/rouge/rouge-4.2.0/lib/rouge/formatter.rb:58:in `each'
2023-10-26T23:54:09Z app[e2865659b14968] lax [info]     /app/tmp/rouge/rouge-4.2.0/lib/rouge/formatter.rb:58:in `filter_escapes'
2023-10-26T23:54:09Z app[e2865659b14968] lax [info]     /app/tmp/rouge/rouge-4.2.0/lib/rouge/formatters/html.rb:20:in `each'
2023-10-26T23:54:09Z app[e2865659b14968] lax [info]     /app/tmp/rouge/rouge-4.2.0/lib/rouge/formatters/html.rb:20:in `stream'
2023-10-26T23:54:09Z app[e2865659b14968] lax [info]     /app/tmp/rouge/rouge-4.2.0/lib/rouge/formatter.rb:74:in `format'
2023-10-26T23:54:09Z app[e2865659b14968] lax [info]     /app/tmp/rouge/rouge-4.2.0/lib/rouge/formatter.rb:46:in `format'
2023-10-26T23:54:09Z app[e2865659b14968] lax [info]     /app/tmp/rouge/rouge-4.2.0/lib/rouge.rb:36:in `highlight'
2023-10-26T23:54:09Z app[e2865659b14968] lax [info]     /app/lib/demo.rb:21:in `result'

@tancnle tancnle force-pushed the bugfix.fix-matlab-builtins-loader branch 2 times, most recently from 0538aee to 6c5414a Compare October 27, 2023 01:52
The issue is picked up via Dingus website.

NameError - uninitialized constant Rouge::Lexers::Matlab
@tancnle tancnle force-pushed the bugfix.fix-matlab-builtins-loader branch from 6c5414a to ebb7a2d Compare October 27, 2023 04:53
@tancnle
Copy link
Collaborator Author

tancnle commented Nov 27, 2023

@jneen Keen to hear your thoughts on this change.

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.

1 participant