Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(34)

Issue 6130045: Using yy_scan_string, which flushes the old buffer does not work. GLSL requires that each input str… (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 11 months ago by Alok Priyadarshi
Modified:
13 years, 11 months ago
Reviewers:
kbr1
CC:
angleproject-review_googlegroups.com
Base URL:
http://angleproject.googlecode.com/svn/trunk/
Visibility:
Public.

Description

Using yy_scan_string, which flushes the old buffer does not work. GLSL requires that each input string is concatenated, but yy_scan_string treats each string individually. Added a custom YY_INPUT which maintains the continuity between each string. Committed: https://code.google.com/p/angleproject/source/detail?r=1066

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : #

Total comments: 8

Patch Set 7 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+318 lines, -187 lines) Patch
M src/compiler/preprocessor/new/Input.h View 1 2 3 4 5 6 1 chunk +31 lines, -10 lines 0 comments Download
M src/compiler/preprocessor/new/Input.cpp View 1 2 3 4 5 6 1 chunk +45 lines, -1 line 0 comments Download
M src/compiler/preprocessor/new/Lexer.h View 1 2 3 4 5 6 2 chunks +11 lines, -4 lines 0 comments Download
M src/compiler/preprocessor/new/Lexer.cpp View 1 2 3 4 5 6 1 chunk +3 lines, -9 lines 0 comments Download
M src/compiler/preprocessor/new/Preprocessor.h View 1 2 3 4 5 6 1 chunk +10 lines, -0 lines 0 comments Download
MM src/compiler/preprocessor/new/pp.l View 1 2 3 4 5 6 6 chunks +28 lines, -82 lines 0 comments Download
M src/compiler/preprocessor/new/pp_lex.cpp View 1 2 3 4 5 6 7 chunks +30 lines, -81 lines 0 comments Download
M tests/build_tests.gyp View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
A tests/preprocessor_tests/input_test.cpp View 1 2 3 4 5 6 1 chunk +159 lines, -0 lines 0 comments Download

Messages

Total messages: 3
Alok Priyadarshi
With this patch, all location tests pass as well. LocationTest.TokenStraddling* tests were failing earlier.
13 years, 11 months ago (2012-04-29 11:28:47 UTC) #1
kbr1
LGTM overall. Couple of minor comments. http://codereview.appspot.com/6130045/diff/2018/src/compiler/preprocessor/new/Input.cpp File src/compiler/preprocessor/new/Input.cpp (right): http://codereview.appspot.com/6130045/diff/2018/src/compiler/preprocessor/new/Input.cpp#newcode29 src/compiler/preprocessor/new/Input.cpp:29: if (mLength[i] == ...
13 years, 11 months ago (2012-04-30 18:31:17 UTC) #2
Alok Priyadarshi
13 years, 11 months ago (2012-05-01 09:43:41 UTC) #3
Thanks!

http://codereview.appspot.com/6130045/diff/2018/src/compiler/preprocessor/new...
File src/compiler/preprocessor/new/Input.cpp (right):

http://codereview.appspot.com/6130045/diff/2018/src/compiler/preprocessor/new...
src/compiler/preprocessor/new/Input.cpp:29: if (mLength[i] == -1)
On 2012/04/30 18:31:17, kbr1 wrote:
> The test against -1 seems fragile. Perhaps < 0 instead?

Done.

http://codereview.appspot.com/6130045/diff/2018/src/compiler/preprocessor/new...
File src/compiler/preprocessor/new/Input.h (right):

http://codereview.appspot.com/6130045/diff/2018/src/compiler/preprocessor/new...
src/compiler/preprocessor/new/Input.h:20: Input(int count, const char* const
string[], const int length[]);
On 2012/04/30 18:31:17, kbr1 wrote:
> Could you document the semantics of the "length" array?

Added documentation to the main function that takes these arguments:
Preprocessor::init().

http://codereview.appspot.com/6130045/diff/2018/tests/preprocessor_tests/inpu...
File tests/preprocessor_tests/input_test.cpp (right):

http://codereview.appspot.com/6130045/diff/2018/tests/preprocessor_tests/inpu...
tests/preprocessor_tests/input_test.cpp:14: EXPECT_FALSE(preprocessor.init(-1,
0, 0));
On 2012/04/30 18:31:17, kbr1 wrote:
> Could you use NULL instead of 0 to indicate null pointers throughout this
test?

Done everywhere.

http://codereview.appspot.com/6130045/diff/2018/tests/preprocessor_tests/inpu...
tests/preprocessor_tests/input_test.cpp:60: }
On 2012/04/30 18:31:17, kbr1 wrote:
> Could you add a test which verifies lexing of two strings with explicitly
> specified lengths?

Added ReadStringsWithLength, which also verifies that some of the characters are
ignored if a length < strlen(str) is specified.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b