Skip to content
Snippets Groups Projects
  1. Apr 09, 2013
  2. Mar 15, 2013
  3. Mar 11, 2013
  4. Jan 29, 2013
  5. Jan 08, 2013
    • Orgad Shaneh's avatar
      Remove braces for single lines of conditions · 29a93998
      Orgad Shaneh authored
      
      #!/usr/bin/env ruby
      
      Dir.glob('**/*.cpp') { |file|
        # skip ast (excluding paste, astpath, and canv'ast'imer)
        next if file =~ /ast[^eip]|keywords\.|qualifiers|preprocessor|names.cpp/i
        s = File.read(file)
        next if s.include?('qlalr')
        orig = s.dup
        s.gsub!(/\n *if [^\n]*{\n[^\n]*\n\s+}(\s+else if [^\n]* {\n[^\n]*\n\s+})*(\s+else {\n[^\n]*\n\s+})?\n/m) { |m|
          res = $&
          if res =~ /^\s*(\/\/|[A-Z_]{3,})/ # C++ comment or macro (Q_UNUSED, SDEBUG), do not touch braces
            res
          else
            res.gsub!('} else', 'else')
            res.gsub!(/\n +} *\n/m, "\n")
            res.gsub(/ *{$/, '')
          end
        }
        s.gsub!(/ *$/, '')
        File.open(file, 'wb').write(s) if s != orig
      }
      
      Change-Id: I3b30ee60df0986f66c02132c65fc38a3fbb6bbdc
      Reviewed-by: default avatarhjk <qthjk@ovi.com>
      29a93998
  6. Dec 06, 2012
  7. Nov 22, 2012
    • Nikolai Kosjar's avatar
      C++: Clean up dev tools. · d0f3d7cb
      Nikolai Kosjar authored
      
      * Add -h and -help options describing the tools and their usage.
      
      * Make the tools compile and run on Windows (MinGW, MSVC).
      
      * Rename project dirs, executables and main source files to more
        meaningful names:
        - Use same base name for project dir, *.pro file, main source file
          and (if applicable) script file.
        - Use the prefix "cplusplus-".
        - The names are now:
            - gen-cpp-ast/generate-ast --> cplusplus-update-frontend
            - mkvisitor --> cplusplus-mkvisitor
            - cplusplus-dump/cplusplus0 --> cplusplus-ast2png
      
      * Get rid of 'c++' shell scripts.
      
      * Get rid of duplicates of 'conf.c++'. Rename to 'pp-configuration.inc'.
      
      * Introduce src/tools/cplusplus-tools-utils containing common stuff
        that is used at least in two tools. 'pp-configuration.inc' can also be
        found here.
      
      * cplusplus-update-frontend:
        - Print file paths of written files to stdout.
        - Convenience: Use default values referencing the appropriate dirs and
          files.
      
      * cplusplus-mkvisitor:
        - Take only one argument, namely the path to AST.h.
        - Convenience: Use default path to AST.h.
      
      * cplusplus-ast2png:
        - Make it run without LD_LIBRARY_PATH.
        - As the name suggests, generate image files in png format (needs
          'dot' from graphviz).
        - Convenience: Read from stdin, which useful for small snippets.
      
      Change-Id: I79c4061fce4a1571c0588dfedd50d4a70715d9df
      Reviewed-by: default avatarErik Verbruggen <erik.verbruggen@digia.com>
      d0f3d7cb
  8. Nov 05, 2012
  9. Oct 05, 2012
  10. Jul 19, 2012
  11. Jan 26, 2012
  12. Jan 13, 2012
  13. Nov 03, 2011
  14. Aug 30, 2011
  15. Jul 06, 2011
  16. May 16, 2011
  17. Apr 19, 2011
  18. Apr 13, 2011
  19. Jan 12, 2011
  20. Jan 06, 2011
  21. Dec 17, 2010
  22. Sep 15, 2010
  23. Sep 09, 2010
    • Erik Verbruggen's avatar
      C++: fixed completion in braceless statements following a control statement. · cacb0db0
      Erik Verbruggen authored
      - Changed generator to generate:
      - Changed AST::lastToken to return 1 if there is none
      - Changed Bind.cpp to set the scope of the block following a control
        statement to extend upto (and not including) the first token after
        the block. So basically, including any whitespace after the control
        statement.
      
      Reviewed-by: Roberto Raggi
      cacb0db0
  24. Aug 12, 2010
  25. Aug 02, 2010
  26. Jul 06, 2010
  27. Jul 02, 2010
  28. Jul 01, 2010
  29. Jun 24, 2010
  30. Mar 18, 2010
  31. Mar 05, 2010
  32. Feb 04, 2010
  33. Feb 02, 2010
Loading