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

Update existing languages with their String litreals. #52

Closed
Aaronepower opened this Issue Aug 21, 2016 · 10 comments

Comments

3 participants
@Aaronepower
Copy link
Owner

Aaronepower commented Aug 21, 2016

Now with the inclusion handling comments while in quotes, and out of them. All existing languages need to be updated with their string type as currently the default is (", ") which obviously doesn't apply to all languages. All that is needed to go to src/lib/language/languages.rs and use the set_quotes() method.

  • ActionScript
  • Ada
  • Assembly
  • Autoconf
  • BASH
  • Batch
  • C
  • C Header
  • Clojure
  • CoffeeScript
  • ColdFusion
  • ColdFusion CFScript
  • Coq
  • C++
  • C++ Header
  • C#
  • C Shell
  • CSS
  • D
  • Dart
  • Device Tree
  • Erlang
  • Forth
  • FORTRAN Legacy
  • FORTRAN Modern
  • Go
  • Handlebars
  • Haskell
  • HTML
  • Idris
  • Isabelle
  • JAI
  • Java
  • JavaScript
  • Julia
  • JSON
  • JSX
  • Kotlin
  • LESS
  • LD Script
  • LISP
  • Lua
  • Makefile
  • Markdown
  • Mustache
  • Nim
  • Objective C
  • Objective C++
  • OCaml
  • Oz
  • Pascal
  • Perl
  • Polly
  • PHP
  • Protocol Buffers
  • Prolog
  • Python
  • QCL
  • R
  • Ruby
  • Ruby HTML
  • Rust
  • Sass
  • Scala
  • Standard ML
  • SQL
  • Swift
  • TeX
  • Plain Text
  • TOML
  • TypeScript
  • Vim Script
  • Unreal Script
  • Wolfram
  • XML
  • YAML
  • Zsh
@abhiQmar

This comment has been minimized.

Copy link

abhiQmar commented Aug 27, 2016

Can you please give an example? I don't quite get it.

CoffeeScript => Language::new(vec!["#"], vec![("###", "###")])
                                     .set_quotes(vec![("\"", "\""), ("'", "'")])

In this constructor we have single line and multiline comment styles being passed. What does the set_quotes function do?

@Aaronepower

This comment has been minimized.

Copy link
Owner

Aaronepower commented Aug 27, 2016

@abhiQmar So by default all languages have [(", ")]. In that example all JavaScript and it's superset languages(CoffeeScript, TypeScript) also have '' to represent String literals. So set_quotes just overrides the default.

@mwilli20

This comment has been minimized.

Copy link
Contributor

mwilli20 commented Sep 10, 2016

Is this still an issue. I don't see anywhere in the code saying which strings aren't done or not. If it isn't done am I too assume the original list is accurate in what needs to be implemented.

@Aaronepower

This comment has been minimized.

Copy link
Owner

Aaronepower commented Sep 10, 2016

@mwilli20 The list in this issue is the canonical list. You are correct in assuming that when the list says it isn't done, it isn't done. Some probably are done through the fact that the default (", "), applies to them. And just need to be verified.

@mwilli20

This comment has been minimized.

Copy link
Contributor

mwilli20 commented Sep 10, 2016

Is there anywhere you know of with a complete and accurate list of this information. If so this seems like an easy issue I could tackle.

On a somewhat related note I see set_quotes is for strings, and new is comments in general, nested comments for that type as well but new_c, new_single, new_hash and etc. what are all these defaults?

I ask only because Haskell says new single but it has two types of comments
-- InlineComment {- BlockComment -} , I could go through and double check comments as well.
https://en.wikipedia.org/wiki/Comparison_of_programming_languages_(syntax)#Comments

@Aaronepower

This comment has been minimized.

Copy link
Owner

Aaronepower commented Sep 10, 2016

@mwilli20 new_* is always required. new requires all the parameters, the rest are just conveivence constructors. So for example if a language's syntax is exactly like C then I just use new_c. set_quotes just overrides the defaults. You can see them all in lib/language/language.rs

@Aaronepower

This comment has been minimized.

Copy link
Owner

Aaronepower commented Sep 10, 2016

@mwilli20 There only way is to spend time searching for a language spec, or reference or similar. For any language you submit also provide it for verification. Feel free to double check my comments if you'd like.

Aaronepower added a commit that referenced this issue Sep 11, 2016

Fixes issue #52 (#61)
Modification on comments:
Batch - Add ::
Lisp - Comments can be nested (www.rosettacode.org/wiki/Comments#Common_Lisp)
Python - Reverted to hash, based on comment thread from pull #59 as
string has a return value

Changes to the quotes
Assembly - Uses ' ' or " "
Bash - Uses ' ' or " "
Batch - They don't use quotes for strings
Cold Fusion - Uses ' ' or " "
D - Uses " " or
Dart - Uses " " or ' ' or """ """ or ''' '''
Forth - Uses " " but new, doesn't have a preset
Fortrans - Use " " or ' '
Idris - Uses " " or """ """
Julia - Uses " " or """ """
Kotlin - Uses " " or """ """
Moustache - Uses " " or ' '
Nim - Uses " " or """ """
Pascal - Uses ' '
Perl - Uses " " or ' '
Php - Uses " " or ' '
Python - Uses " " or ' ' or """ """ or ''' '''
Ruby - Uses " " or ' '
Sass - Uses " " or ' '
Sql - Uses ' '
Toml - Uses " " or ' ' or """ """ or ''' '''
Typescript - Uses " " or ' ' or
Vimscript - Uses " " or ' '
Yaml - Uses " " or ' '
Zsh - Uses " " or ' '

@Aaronepower Aaronepower reopened this Sep 11, 2016

@Aaronepower

This comment has been minimized.

Copy link
Owner

Aaronepower commented Sep 11, 2016

@mwilli20 Can you confirm that you've covered all the open languages on the list?

@mwilli20

This comment has been minimized.

Copy link
Contributor

mwilli20 commented Sep 11, 2016

@Aaronepower Yes all languages on the list have been covered.

In pull reqeust #61, for any language that uses " " only I didn't edit it due to the constructors, except forth which used new, which had no default quote setting.

@Aaronepower

This comment has been minimized.

Copy link
Owner

Aaronepower commented Sep 11, 2016

@mwilli20 Good enough for me.

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