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

Add support for YAML (like XML) #993

Closed
scabug opened this Issue Jun 2, 2008 · 3 comments

Comments

Projects
None yet
1 participant
@scabug
Copy link

scabug commented Jun 2, 2008

It would be amazing if Scala integrated YAML support (the format used by Ruby on Rails for all their config files) into the language:
http://en.wikipedia.org/wiki/YAML

in particular block literals:
http://en.wikipedia.org/wiki/YAML#Block_literals

So, the equivalent XML code:

val labPhoneBook =
   <phonebook>
     <descr>Phone numbers of<b>XML</b> hackers.</descr>
     <entry>
         <name>Burak</name>
         <phone where="work"> +41 21 693 68 67 </phone>
         <phone where="mobile"> +41 78 601 54 36 </phone>
     </entry>
     <entry>
         <name>Gosling</name>
         <phone where="work"> +41 21 693 68 67 </phone>
         <phone where="mobile"> +41 78 601 54 36 </phone>
     </entry>
   </phonebook>;

could become something like:

val labPhoneBook = |
   descr: Phone numbers of<b>XML</b> hackers.
   entries:
       - entry:
          name: Burak
          phones: [work: +41 21 693 68 67, mobile: +41 78 601 54 36]
       - entry:
          name: Gosling
          phones: [work: +41 21 693 68 67, mobile: +41 78 601 54 36]
;
@scabug

This comment has been minimized.

Copy link
Author

scabug commented Jun 2, 2008

Imported From: https://issues.scala-lang.org/browse/SI-993?orig=1
Reporter: Jacek (jacek)

@scabug

This comment has been minimized.

Copy link
Author

scabug commented Jun 2, 2008

Geoffrey Alan Washburn (washburn) said:
This would probably be better requested through the SIP process.

Still, it would be interesting whether it would be possible to factor out the XML syntactic sugar into a compiler plugin, such that YAML could be implemented as a plugin as well. However, I imagine given the current implementation of the parser this would probably be kind of difficult. It would be pretty simple if the scanner and parser were defined using something like the combinator library, where it would be easy to extend the grammar in an object-oriented fashion.

@scabug

This comment has been minimized.

Copy link
Author

scabug commented Jun 10, 2008

Michael Pradel (pradel) said:
After discussion in the Scala meeting, it seems to be too complicated with the current parser implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment