-
Notifications
You must be signed in to change notification settings - Fork 453
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
JSX/regexp ambiguity in jslexer #640
Comments
The JavaScript lexer in Babel is far from perfect, unfortunately... It might be a good idea for a future version to use e.g. https://github.com/Kronuz/esprima-python when it's available (i.e. an optional dependency) for more robust parsing. |
Thanks, I might take a look. I am low on time unfortunately right now. For reference, lexer is jslexer.py |
Seems that |
I don't see how to fix this. The tokenizer can't possibly tell if A parser would be able to tell if it's currently in a JSX tag or not and resolve the ambiguity, but there is no such parsing being done in Babel. Simply keeping track of JSX open/close tokens wouldn't be enough because regexps can appear inside JSX tags ( I think I'll have to leave that alone, sorry! Wrote a test:def test_regex():
assert list(jslexer.tokenize('''
re = />/g;
''')) == [
('name', 're', 2),
('operator', '=', 2),
('regexp', '/>/', 2),
('operator', ';', 2),
] |
There's an issue in odoo when extracing translatable source terms from the bundled library file `o_spreadsheet.js`. Some terms are not extracted. Babel doesn't correctly tokenize the regex /"/ As a result, all following tokens are fucked up and source terms are no longer exported after this point. It seems to be known that babel js lexer isn't perfect. python-babel/babel#467 python-babel/babel#616 python-babel/babel#640 python-babel/babel#791
There's an issue in odoo when extracing translatable source terms from the bundled library file `o_spreadsheet.js`. Some terms are not extracted. Babel doesn't correctly tokenize the regex /"/ As a result, all following tokens are fucked up and source terms are no longer exported after this point. It seems to be known that babel js lexer isn't perfect. python-babel/babel#467 python-babel/babel#616 python-babel/babel#640 python-babel/babel#791 closes #1444 Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
There's an issue in odoo when extracing translatable source terms from the bundled library file `o_spreadsheet.js`. Some terms are not extracted. Babel doesn't correctly tokenize the regex /"/ As a result, all following tokens are fucked up and source terms are no longer exported after this point. It seems to be known that babel js lexer isn't perfect. python-babel/babel#467 python-babel/babel#616 python-babel/babel#640 python-babel/babel#791 X-original-commit: df307ed
There's an issue in odoo when extracing translatable source terms from the bundled library file `o_spreadsheet.js`. Some terms are not extracted. Babel doesn't correctly tokenize the regex /"/ As a result, all following tokens are fucked up and source terms are no longer exported after this point. It seems to be known that babel js lexer isn't perfect. python-babel/babel#467 python-babel/babel#616 python-babel/babel#640 python-babel/babel#791 closes #1461 X-original-commit: df307ed Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com> Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
There's an issue in odoo when extracing translatable source terms from the bundled library file `o_spreadsheet.js`. Some terms are not extracted. Babel doesn't correctly tokenize the regex /"/ As a result, all following tokens are fucked up and source terms are no longer exported after this point. It seems to be known that babel js lexer isn't perfect. python-babel/babel#467 python-babel/babel#616 python-babel/babel#640 python-babel/babel#791
There's an issue in odoo when extracing translatable source terms from the bundled library file `o_spreadsheet.js`. Some terms are not extracted. Babel doesn't correctly tokenize the regex /"/ As a result, all following tokens are fucked up and source terms are no longer exported after this point. It seems to be known that babel js lexer isn't perfect. python-babel/babel#467 python-babel/babel#616 python-babel/babel#640 python-babel/babel#791 closes #1462 Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com> Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
There's an issue in odoo when extracing translatable source terms from the bundled library file `o_spreadsheet.js`. Some terms are not extracted. Babel doesn't correctly tokenize the regex /"/ As a result, all following tokens are fucked up and source terms are no longer exported after this point. It seems to be known that babel js lexer isn't perfect. python-babel/babel#467 python-babel/babel#616 python-babel/babel#640 python-babel/babel#791 X-original-commit: d711ad2
There's an issue in odoo when extracing translatable source terms from the bundled library file `o_spreadsheet.js`. Some terms are not extracted. Babel doesn't correctly tokenize the regex /"/ As a result, all following tokens are fucked up and source terms are no longer exported after this point. It seems to be known that babel js lexer isn't perfect. python-babel/babel#467 python-babel/babel#616 python-babel/babel#640 python-babel/babel#791 X-original-commit: d711ad2
There's an issue in odoo when extracing translatable source terms from the bundled library file `o_spreadsheet.js`. Some terms are not extracted. Babel doesn't correctly tokenize the regex /"/ As a result, all following tokens are fucked up and source terms are no longer exported after this point. It seems to be known that babel js lexer isn't perfect. python-babel/babel#467 python-babel/babel#616 python-babel/babel#640 python-babel/babel#791 X-original-commit: d711ad2
There's an issue in odoo when extracing translatable source terms from the bundled library file `o_spreadsheet.js`. Some terms are not extracted. Babel doesn't correctly tokenize the regex /"/ As a result, all following tokens are fucked up and source terms are no longer exported after this point. It seems to be known that babel js lexer isn't perfect. python-babel/babel#467 python-babel/babel#616 python-babel/babel#640 python-babel/babel#791 closes #1465 X-original-commit: d711ad2 Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com> Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
There's an issue in odoo when extracing translatable source terms from the bundled library file `o_spreadsheet.js`. Some terms are not extracted. Babel doesn't correctly tokenize the regex /"/ As a result, all following tokens are fucked up and source terms are no longer exported after this point. It seems to be known that babel js lexer isn't perfect. python-babel/babel#467 python-babel/babel#616 python-babel/babel#640 python-babel/babel#791 closes #1464 X-original-commit: d711ad2 Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com> Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
There's an issue in odoo when extracing translatable source terms from the bundled library file `o_spreadsheet.js`. Some terms are not extracted. Babel doesn't correctly tokenize the regex /"/ As a result, all following tokens are fucked up and source terms are no longer exported after this point. It seems to be known that babel js lexer isn't perfect. python-babel/babel#467 python-babel/babel#616 python-babel/babel#640 python-babel/babel#791 closes #1463 X-original-commit: d711ad2 Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com> Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
There's an issue in odoo when extracing translatable source terms from the bundled library file `o_spreadsheet.js`. Some terms are not extracted. Babel doesn't correctly tokenize the regex /"/ As a result, all following tokens are fucked up and source terms are no longer exported after this point. It seems to be known that babel js lexer isn't perfect. python-babel/babel#467 python-babel/babel#616 python-babel/babel#640 python-babel/babel#791 closes odoo/o-spreadsheet#1461 X-original-commit: df307ed6a0e79370a8405b902df1e909671fb035 Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com> Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
There's an issue in odoo when extracing translatable source terms from the bundled library file `o_spreadsheet.js`. Some terms are not extracted. Babel doesn't correctly tokenize the regex /"/ As a result, all following tokens are fucked up and source terms are no longer exported after this point. It seems to be known that babel js lexer isn't perfect. python-babel/babel#467 python-babel/babel#616 python-babel/babel#640 python-babel/babel#791 closes odoo/o-spreadsheet#1464 X-original-commit: d711ad2cb1ef220d8a02853243859a4572748d61 Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com> Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
There's an issue in odoo when extracing translatable source terms from the bundled library file `o_spreadsheet.js`. Some terms are not extracted. Babel doesn't correctly tokenize the regex /"/ As a result, all following tokens are fucked up and source terms are no longer exported after this point. It seems to be known that babel js lexer isn't perfect. python-babel/babel#467 python-babel/babel#616 python-babel/babel#640 python-babel/babel#791 closes odoo/o-spreadsheet#1463 X-original-commit: d711ad2cb1ef220d8a02853243859a4572748d61 Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com> Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
After a regular expression like
/>/
, Babel ignores all messages until the next one.Mapping:
Source file:
Result POT:
The text was updated successfully, but these errors were encountered: