Skip to content
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

detect mixed spaces/tabs or missing parameters #338

Closed
meetar opened this issue Jun 21, 2016 · 8 comments
Closed

detect mixed spaces/tabs or missing parameters #338

meetar opened this issue Jun 21, 2016 · 8 comments

Comments

@meetar
Copy link
Member

meetar commented Jun 21, 2016

capture

In this case the normal map just silently failed to draw, but the rest of the map did. Not sure how extensive the current internal linting is or if there's any kind of error which could be thrown in this case...

@louh
Copy link
Contributor

louh commented Jun 21, 2016

Tabs are technically forbidden in YAML, and Tangram's internal YAML parser has not resolved this since the issue was opened in 2013, even after the YAML spec creator weighed in: nodeca/js-yaml#80

The summary is that we have to catch these errors ourselves or do the work of patching js-yaml upstream.

Incidentally, I have considered writing functionality in Tangram Play that can highlight these as errors, or convert them for you. We already insert spaces instead of a tab character when you press tab, so there's no chance of accidentally inserting tabs when authoring in Play.

@meetar
Copy link
Member Author

meetar commented Jun 21, 2016

Illuminating: nodeca/js-yaml#80 (comment) – would it be worth considering libyaml at this point?

@louh
Copy link
Contributor

louh commented Jun 21, 2016

Libyaml is python, I believe...? Is there a direct JS port?

On Tue, Jun 21, 2016, 10:43 AM Peter Richardson notifications@github.com
wrote:

Illuminating: nodeca/js-yaml#80 (comment)
nodeca/js-yaml#80 (comment)
would it be worth considering libyaml at this point?


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#338 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/ACb1tK5F03u-LDBqDrsa0mXFlteLc3XJks5qN_iFgaJpZM4I6Rd3
.

@meetar
Copy link
Member Author

meetar commented Jun 21, 2016

Ah, missed that. Not to my knowledge.

@matteblair
Copy link
Member

LibYAML is a C library, with bindings to many languages. It could probably be transpiled to JS with emscripten but I'm not aware that this has been done already. LibYAML also has a SAX-style parsing interface, which deterred us from using it in tangram-es.

@bcamper
Copy link
Member

bcamper commented Jun 21, 2016

From the research I've done, I believe js-yaml is far and away the best JS YAML library.

@louh
Copy link
Contributor

louh commented Jun 21, 2016

Let's patch it!![](https://link.nylas.com/open/c3ccrw0t3xj00dylcqc5uc6ma
/local-
0c7eff53-ac75?r=cmVwbHkrMDAyNmY1YjRjYmNmNjQ2OTIxNmZhZjkzNzA0ZmU0OTdjODUxNGU4M2U3YzQ3Y2JiOTJjZjAwMDAwMDAxMTM4MTFiZDk5MmExNjljZTA5OWRhZmYyQHJlcGx5LmdpdGh1Yi5jb20=)

On Jun 21 2016, at 11:14 am, Brett Camper <notifications@github.com>
wrote:

From the research I've done, I believe js-yaml is far and away the best JS
YAML library.


You are receiving this because you commented.
Reply to this email directly, view it on
GitHub
,
or mute the
thread
.

@meetar
Copy link
Member Author

meetar commented Jun 29, 2016

Closing with WONTFIX as out of scope.

@meetar meetar closed this as completed Jun 29, 2016
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

4 participants