Code Monkey home page Code Monkey logo

Comments (4)

slimsag avatar slimsag commented on September 28, 2024

Digging a bit deeper also shows that generated code is missing blank lines completely, for example a generated debug.go file

// Glow automatically generated OpenGL binding: http://github.com/go-gl/glow
package gl
import "C"
import "unsafe"
type DebugProc func(
    source uint32,
    gltype uint32,
    id uint32,
    severity uint32,
    length int32,
    message string,
    userParam unsafe.Pointer)
var userDebugCallback DebugProc
//export glowDebugCallback_glcore20
func glowDebugCallback_glcore20(
    source uint32,
    gltype uint32,
    id uint32,
    severity uint32,
    length int32,
    message *uint8,
    userParam unsafe.Pointer) {
  if userDebugCallback != nil {
    userDebugCallback(source, gltype, id, severity, length, GoStr(message), userParam)
  }
}

from glow.

errcw avatar errcw commented on September 28, 2024

shows that generated code is missing blank lines completely

For better or worse this is working as intended. Indeed the template output is filtered through BlankLineStrippingWriter largely to remove the huge amounts of hard-to-read whitespace that would otherwise be present in the generated files. There might be a clever middle ground but nothing I have yet bothered to implement.

from glow.

slimsag avatar slimsag commented on September 28, 2024

You're right. Looking at the code it's a much more complex issue than I originally thought. I am creating a simple solution that should give us nice package synopsis though, at least.

from glow.

capnm avatar capnm commented on September 28, 2024

@slimsag IMHO #41 is just opening a can of worms. I think a better solution is to scratch the BlankLineStrippingWriter altogether and fix the template. You can stop the template inserting eol with

bla{{/*
*/}}bla

and for the C typedefs re-implement Replace e.g. to

+func Replace(s, old, new string) string {
+       if s[:len(s)] != "\n" {
+               s+="\n"
+       }
+       return strings.Replace(s, old, new, -1)
+}

EDIT: created #44

from glow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.