Comments (7)
You can see it here:
from kataw.
@aladdin-add This is a huge problem. Take this case fo\u0072 = x;
. It get printed into for(; ; )
. It's actually invalid syntax
from kataw.
in non-error-recovery mode, please do not ignore the errors silently! just throw the errors?
from kataw.
A printer shouldn't run in a error-recovery mode. Can you add a error handler in the test runner for this?
from kataw.
bar ? (, => {}) : baz;
throws on null
because the :
token doesn't exist in the CST tree.
from kataw.
@aladdin-add this is how I do it locally. It will throw an error an never print the invalid syntax. Can you adopt this?
const source = parse("bar ? (, => {}) : baz;",
'root',
Context.None,
false,
{ allowTypes: true },
function (a: any, b: any, c: any, d: any) {
throw b + '(' + c + ', ' + d + ')';
}
);
console.log(printSourceFile(source));
from kataw.
closing as fixed in the printer PR
from kataw.
Related Issues (20)
- Implement CLI and kataw ignore comment HOT 24
- test runner - printed VALID code is INVALID HOT 19
- Add printer options in test runner HOT 1
- Add REPL HOT 1
- Implement printer options HOT 6
- implement pragma comments HOT 1
- The test runner goes crazy - 100 MB files HOT 6
- Test runner creates random 100 MB files HOT 6
- Test runner playing with backticks HOT 3
- test runner doesn't count to 100% HOT 1
- Implements linting and warnings HOT 3
- test runner - separate diagnostics HOT 8
- test runner - test fuzzer
- "re-design" and improve the reporters HOT 2
- 用 Kataw 替换 ESLint HOT 1
- JSON, YAML or JS ?? HOT 1
- Still in development? HOT 1
- Possible bug parsing destructured arrow function parameters HOT 1
- Possible bug regarding the use of IndexExpression vs. MemberAccessExpression
- Source maps HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kataw.