• Activity
  • Votes
  • Comments
  • New
  • All activity
  • Showing only topics in ~test with the tag "syntax highlighting". Back to normal view / Search all groups
    1. Borked up syntax highlighting (for a GitLab issue)

      (1) This works okay: typedef struct metres metres_t; int metres_get_value(metres_t *x); metres_t *metres_add(metres_t *x, metres_t *y); metres_t *metres_new(int value); void metres_delete(metres_t...

      (1) This works okay:

      typedef struct metres metres_t;
      
      int       metres_get_value(metres_t *x);
      metres_t *metres_add(metres_t *x, metres_t *y);
      metres_t *metres_new(int value);
      void      metres_delete(metres_t *x);
      

      (2) This works badly:

      • typedef struct metres metres_t;
        

        int metres_get_value(metres_t *x);
        metres_t *metres_add(metres_t *x, metres_t *y);
        metres_t *metres_new(int value);
        void metres_delete(metres_t *x);

      (3) This works slightly better, but the list bullet is weird:

      • typedef struct metres metres_t;
        
        int       metres_get_value(metres_t *x);
        metres_t *metres_add(metres_t *x, metres_t *y);
        metres_t *metres_new(int value);
        void      metres_delete(metres_t *x);
        
      4 votes
    2. Syntax test

      C: int main(void) { puts("test"); return 0; } Go: package main import "os" func main() { _, err := os.Stdout.WriteString("test") if err != nil { _, _ = os.Stderr.WriteString("fail") } } Ruby:...

      C:

      int main(void)
      {
      	puts("test");
      	return 0;
      }
      

      Go:

      package main
      
      import "os"
      
      func main() {
      	_, err := os.Stdout.WriteString("test")
      	if err != nil {
      		_, _ = os.Stderr.WriteString("fail")
      	}
      }
      

      Ruby:

      10.times { |n| puts "test_#{ n }" }
      

      XML:

      <html>
        <body>
          <h1>test</h1>
        </body>
      </html>
      
      1 vote