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

Minify fails on jquery file #109

Open
Alexey-T opened this issue Jul 4, 2019 · 1 comment
Open

Minify fails on jquery file #109

Alexey-T opened this issue Jul 4, 2019 · 1 comment

Comments

@Alexey-T
Copy link

Alexey-T commented Jul 4, 2019

I use latest GH version. I use CudaText plugin "JS Format" which is here
https://github.com/cudatext-addons/cuda_js_format

  • get last jquery JS file (minified)
  • run plugin to format it to full code - OK
  • run plugin to minify it (uses slimit) - fail
Startup: total: 1040ms, including plugins: 90ms
Python 3.6.8
Loading toolbar config
Illegal character '"' at 1:6981 after LexToken(EQ,'=',1,6979)
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/user/.config/cudatext/py/cuda_js_format/__init__.py", line 70, in minify
    format_proc.run(do_minify)
  File "/home/user/.config/cudatext/py/cuda_js_format/format_proc.py", line 83, in run
    text = do_format(text)
  File "/home/user/.config/cudatext/py/cuda_js_format/__init__.py", line 47, in do_minify
    return slimit.minify(text, mangle=True, mangle_toplevel=True)
  File "/home/user/.config/cudatext/py/cuda_js_format/slimit/minifier.py", line 38, in minify
    tree = parser.parse(text)
  File "/home/user/.config/cudatext/py/cuda_js_format/slimit/parser.py", line 93, in parse
    return self.parser.parse(text, lexer=self.lexer, debug=debug)
  File "/home/user/.config/cudatext/py/cuda_js_format/ply/yacc.py", line 333, in parse
    return self.parseopt_notrack(input, lexer, debug, tracking, tokenfunc)
  File "/home/user/.config/cudatext/py/cuda_js_format/ply/yacc.py", line 1201, in parseopt_notrack
    tok = call_errorfunc(self.errorfunc, errtoken, self)
  File "/home/user/.config/cudatext/py/cuda_js_format/ply/yacc.py", line 192, in call_errorfunc
    r = errorfunc(token)
  File "/home/user/.config/cudatext/py/cuda_js_format/slimit/parser.py", line 116, in p_error
    self._raise_syntax_error(token)
  File "/home/user/.config/cudatext/py/cuda_js_format/slimit/parser.py", line 89, in _raise_syntax_error
    self.lexer.prev_token, self.lexer.token())
SyntaxError: Unexpected token (CONDOP, '?') at 1:6983 between LexToken(LPAREN,'(',1,6982) and LexToken(COLON,':',1,6984)
@Alexey-T
Copy link
Author

Alexey-T commented Jul 4, 2019

I minify this file
jquery-3.4.1.full.zip

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

1 participant