Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2009-11

h2pas truncates strings

6 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Wimpie Nortje

Hallo

I am trying to convert a .h to pascal with h2pas. The header file contains many declarations with lines of 400 characters or longer. h2pas creates the *.tmp.h file with all the code intact but the .pas file's lines are cut off at 256 characters. Is there an easy way around this problem, ie not manually changing the .h file?

Reply by email

Henry Vermaak
to Wimpie Nortje

2009/11/10 Wimpie Nortje :

Show quoted text 7 lines
Hallo I am trying to convert a .h to pascal with h2pas. The header file contains many declarations with lines of 400 characters or longer. h2pas creates the *.tmp.h file with all the code intact but the .pas file's lines are cut off at 256 characters. Is there an easy way around this problem, ie not manually changing the .h file?

I guess patching h2pas for this is the right thing to do, but as a workaround you can always run `indent` over the h file first to chop the lines.

Henry

Reply by email

Wimpie Nortje
to Henry Vermaak

Thanks, I will try that.

Henry Vermaak wrote 21 lines
2009/11/10 Wimpie Nortje : > Hallo > > I am trying to convert a .h to pascal with h2pas. The header file contains > many declarations with lines of 400 characters or longer. h2pas creates the > *.tmp.h file with all the code intact but the .pas file's lines are cut off > at 256 characters. Is there an easy way around this problem, ie not manually > changing the .h file? > I guess patching h2pas for this is the right thing to do, but as a workaround you can always run `indent` over the h file first to chop the lines. Henry _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email

Wimpie Nortje
to Henry Vermaak: 2009/11/10 Wimpie Nortje : I guess patching h2pas for this is the right thing to do, but…

Ok, I've tried indent and it doesn't do the job because the comments are also 400 chars long.

I also tried to add {$H+} to the top of h2pas.pas but the solution is not that easy.

If someone could give me a pointer of where to start, maybe I can try to fix it. For starters, what is the yacc and lex files for?

Henry Vermaak wrote 21 lines
2009/11/10 Wimpie Nortje : > Hallo > > I am trying to convert a .h to pascal with h2pas. The header file contains > many declarations with lines of 400 characters or longer. h2pas creates the > *.tmp.h file with all the code intact but the .pas file's lines are cut off > at 256 characters. Is there an easy way around this problem, ie not manually > changing the .h file? > I guess patching h2pas for this is the right thing to do, but as a workaround you can always run `indent` over the h file first to chop the lines. Henry _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email

Henry Vermaak
to Wimpie Nortje

2009/11/10 Wimpie Nortje :

Ok, I've tried indent and it doesn't do the job because the comments are also 400 chars long. From indent man page:

-ln, --line-lengthn
Set maximum line length for non-comment lines to n. See BREAKING LONG LINES.
-lcn, --comment-line-lengthn
Set maximum line length for comment formatting to n. See COMMENTS.

Henry

Reply by email

Wimpie Nortje
to Henry Vermaak

indent can only add or delete whitespace. Comments that start with // and extend beyond the -lcn limit are left alone.

Henry Vermaak wrote 21 lines
2009/11/10 Wimpie Nortje : > Ok, I've tried indent and it doesn't do the job because the comments are > also 400 chars long. > >From indent man page: -ln, --line-lengthn Set maximum line length for non-comment lines to n. See BREAKING LONG LINES. -lcn, --comment-line-lengthn Set maximum line length for comment formatting to n. See COMMENTS. Henry _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email