Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Issue 9695048: Template parser (Closed)

Created:
8 years, 9 months ago by terry
Modified:
8 years, 9 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

More changes for CSS to run under VM. Need unique name for library collision with template parser. Few more changes to work under VM. More changes for lang.dart seperation. Seperation from lang.dart (tokenizer can't access private fields of base class in another library). This was allowed in frog but not in the VM. VM is right so need to sever dependency. BUG= TEST= Committed: https://code.google.com/p/dart/source/detail?r=5544

Patch Set 1 #

Patch Set 2 : Support for CSS inside of a template #

Patch Set 3 : Public startIndex member to share parsing between CSS and template parsers. #

Patch Set 4 : Initial template parsing code #

Patch Set 5 : More cleanup for VM #

Patch Set 6 : Fixed CSS test suite. #

Patch Set 7 : Fix GIT mixup - ugh #

Total comments: 25

Patch Set 8 : Common tools library #

Patch Set 9 : tools filesystem #

Patch Set 10 : Few more changes to run uitest in dartium #

Patch Set 11 : Few more changes for uitest to run in dartium #

Patch Set 12 : Siggi's CL comments added. #

Patch Set 13 : Siggi's comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+6966 lines, -222 lines) Patch
A utils/css/css View 1 2 3 4 5 6 7 1 chunk +25 lines, -0 lines 0 comments Download
M utils/css/css.dart View 1 2 3 4 5 6 7 8 9 2 chunks +23 lines, -17 lines 0 comments Download
A utils/css/css.html View 1 2 3 4 5 6 7 8 9 1 chunk +8 lines, -0 lines 0 comments Download
A utils/css/cssoptions.dart View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +93 lines, -0 lines 0 comments Download
M utils/css/cssselectorexception.dart View 1 chunk +1 line, -1 line 0 comments Download
M utils/css/generate.dart View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M utils/css/parser.dart View 1 9 chunks +63 lines, -27 lines 0 comments Download
A utils/css/source.dart View 1 chunk +186 lines, -0 lines 0 comments Download
A utils/css/token.dart View 1 chunk +60 lines, -0 lines 0 comments Download
M utils/css/tokenizer.dart View 1 2 3 4 5 9 chunks +38 lines, -21 lines 0 comments Download
A utils/css/tokenizer_base.dart View 1 chunk +454 lines, -0 lines 0 comments Download
M utils/css/tokenkind.dart View 3 chunks +3 lines, -3 lines 0 comments Download
M utils/css/tool.dart View 1 2 3 4 5 6 7 8 9 4 chunks +11 lines, -11 lines 0 comments Download
M utils/css/tree.dart View 49 chunks +90 lines, -90 lines 0 comments Download
A utils/css/treebase.dart View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +124 lines, -0 lines 0 comments Download
M utils/css/uitest.dart View 1 2 3 4 5 6 7 8 9 10 11 5 chunks +24 lines, -17 lines 0 comments Download
M utils/css/validate.dart View 1 3 chunks +3 lines, -3 lines 0 comments Download
A utils/css/world.dart View 1 2 3 4 5 1 chunk +170 lines, -0 lines 0 comments Download
A utils/lib/file_system.dart View 1 2 3 4 5 6 7 8 1 chunk +75 lines, -0 lines 0 comments Download
A utils/lib/file_system_memory.dart View 1 2 3 4 5 6 7 8 1 chunk +40 lines, -0 lines 0 comments Download
A utils/lib/file_system_vm.dart View 1 2 3 4 5 6 7 8 1 chunk +42 lines, -0 lines 0 comments Download
A utils/template/codegen.dart View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +767 lines, -0 lines 0 comments Download
A utils/template/htmltree.dart View 1 2 3 1 chunk +348 lines, -0 lines 0 comments Download
A utils/template/parser.dart View 1 2 3 4 5 6 7 1 chunk +567 lines, -0 lines 0 comments Download
A utils/template/source.dart View 1 2 3 1 chunk +186 lines, -0 lines 0 comments Download
A utils/template/template View 1 2 3 4 5 6 7 1 chunk +78 lines, -0 lines 0 comments Download
A utils/template/template.dart View 1 2 3 4 5 6 7 8 9 1 chunk +46 lines, -0 lines 0 comments Download
A utils/template/template.html View 1 2 3 4 5 6 7 8 9 1 chunk +8 lines, -0 lines 0 comments Download
A utils/template/temploptions.dart View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +93 lines, -0 lines 0 comments Download
A utils/template/token.dart View 1 2 3 1 chunk +60 lines, -0 lines 0 comments Download
A utils/template/tokenizer.dart View 1 2 3 4 5 6 7 1 chunk +302 lines, -0 lines 0 comments Download
A utils/template/tokenizer_base.dart View 1 2 3 1 chunk +464 lines, -0 lines 0 comments Download
A utils/template/tokenkind.dart View 1 2 3 4 5 6 7 1 chunk +456 lines, -0 lines 0 comments Download
A utils/template/tool.dart View 1 2 3 4 5 6 7 8 9 1 chunk +109 lines, -0 lines 0 comments Download
A utils/template/tree.dart View 1 2 3 1 chunk +108 lines, -0 lines 0 comments Download
A utils/template/uitest.dart View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +572 lines, -0 lines 0 comments Download
A utils/template/utils.dart View 1 2 3 4 5 6 7 8 9 1 chunk +52 lines, -0 lines 0 comments Download
A utils/template/world.dart View 1 2 3 4 5 6 7 8 9 1 chunk +169 lines, -0 lines 0 comments Download
M utils/tests/css/src/DeclarationTest.dart View 1 2 3 4 5 6 7 7 chunks +6 lines, -7 lines 0 comments Download
M utils/tests/css/src/ExpressionTest.dart View 1 2 3 4 5 6 7 14 chunks +20 lines, -21 lines 0 comments Download
M utils/tests/css/src/SelectorLiteralTest.dart View 1 2 3 4 5 6 7 2 chunks +2 lines, -3 lines 0 comments Download
A utils/tests/template/README.txt View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +58 lines, -0 lines 0 comments Download
A utils/tests/template/applications.tmpl View 1 2 3 4 5 6 1 chunk +12 lines, -0 lines 0 comments Download
A utils/tests/template/complex_datamodel.dart View 1 2 3 4 5 6 1 chunk +122 lines, -0 lines 0 comments Download
A utils/tests/template/name_entry.tmpl View 1 2 3 4 5 6 1 chunk +8 lines, -0 lines 0 comments Download
A utils/tests/template/name_entry2.tmpl View 1 2 3 4 5 6 1 chunk +14 lines, -0 lines 0 comments Download
A utils/tests/template/name_entry_css.tmpl View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
A utils/tests/template/productview.tmpl View 1 2 3 4 5 6 1 chunk +12 lines, -0 lines 0 comments Download
A utils/tests/template/productview2.tmpl View 1 2 3 4 5 6 1 chunk +16 lines, -0 lines 0 comments Download
A utils/tests/template/real_app.dart View 1 2 3 4 5 6 1 chunk +108 lines, -0 lines 0 comments Download
A utils/tests/template/realviews.tmpl View 1 2 3 4 5 6 1 chunk +106 lines, -0 lines 0 comments Download
A utils/tests/template/run View 1 2 3 4 5 6 1 chunk +91 lines, -0 lines 0 comments Download
A utils/tests/template/sample.dart View 1 2 3 4 5 6 1 chunk +243 lines, -0 lines 0 comments Download
A utils/tests/template/test_complex.dart View 1 2 3 4 5 6 1 chunk +17 lines, -0 lines 0 comments Download
A utils/tests/template/test_complex2.dart View 1 2 3 4 5 6 1 chunk +16 lines, -0 lines 0 comments Download
A utils/tests/template/test_list.dart View 1 2 3 4 5 6 1 chunk +25 lines, -0 lines 0 comments Download
A utils/tests/template/test_simple.dart View 1 2 3 4 5 6 1 chunk +16 lines, -0 lines 0 comments Download
A utils/tests/template/test_with.dart View 1 2 3 4 5 6 1 chunk +23 lines, -0 lines 0 comments Download
A utils/tests/template/top_searches.tmpl View 1 2 3 4 5 6 1 chunk +18 lines, -0 lines 0 comments Download
A utils/tests/template/top_searches2.tmpl View 1 2 3 4 5 6 1 chunk +64 lines, -0 lines 0 comments Download
A utils/tests/template/top_searches_css.tmpl View 1 2 3 4 5 6 1 chunk +49 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
terry
8 years, 9 months ago (2012-03-14 19:58:56 UTC) #1
Siggi Cherem (dart-lang)
some initial drive-by comments, mostly nitpicks. I can take a closer look when I get ...
8 years, 9 months ago (2012-03-15 01:21:25 UTC) #2
terry
8 years, 9 months ago (2012-03-15 19:02:48 UTC) #3
Thanks Siggi.  See comments inline.

https://chromiumcodereview.appspot.com/9695048/diff/8037/utils/css/css
File utils/css/css (right):

https://chromiumcodereview.appspot.com/9695048/diff/8037/utils/css/css#newcode20
utils/css/css:20: $BASE_DIR/../../frog/minfrog --libdir=$BASE_DIR/../../frog/lib
$BASE_DIR/tool.dart $SRCFILE $OUTPUT
On 2012/03/15 01:21:25, sigmund wrote:
> switch to run tool.dart directly in the vm?

Done.

https://chromiumcodereview.appspot.com/9695048/diff/8037/utils/css/cssoptions...
File utils/css/cssoptions.dart (right):

https://chromiumcodereview.appspot.com/9695048/diff/8037/utils/css/cssoptions...
utils/css/cssoptions.dart:14: // TODO(sigmund): make into a generic option
parser...
On 2012/03/15 01:21:25, sigmund wrote:
> what did I do?
> 
> :) - remove the TODO since this is copied from frog?

Done.

https://chromiumcodereview.appspot.com/9695048/diff/8037/utils/css/treebase.dart
File utils/css/treebase.dart (right):

https://chromiumcodereview.appspot.com/9695048/diff/8037/utils/css/treebase.d...
utils/css/treebase.dart:7: class ASTNode {
Since frog will be going away I didn't want to rely on code in lang library. 
I've moved replicated code to both CSS and the template parser.  I'll be
refactoring to a tokenizing utility library that will be shared by both css and
template. 
On 2012/03/15 01:21:25, sigmund wrote:
> there is a lot of code copied from the parser in frog (here, tokenizer, etc).
It
> would be nice if some of this code could be shared... consult with jim/john
for
> ideas?

https://chromiumcodereview.appspot.com/9695048/diff/8037/utils/css/treebase.d...
utils/css/treebase.dart:26: // TODO(terry): Should be abstract class but frog
doesn't support abstract class keyword yet.
On 2012/03/15 01:21:25, sigmund wrote:
> 80 col (here and below)

Done.

https://chromiumcodereview.appspot.com/9695048/diff/8037/utils/css/uitest.dart
File utils/css/uitest.dart (right):

https://chromiumcodereview.appspot.com/9695048/diff/8037/utils/css/uitest.dar...
utils/css/uitest.dart:9: // TODO(terry): Remove use for debug only.
On 2012/03/15 01:21:25, sigmund wrote:
> agree (and the call in line 50)

Done.

https://chromiumcodereview.appspot.com/9695048/diff/8037/utils/template/codeg...
File utils/template/codegen.dart (right):

https://chromiumcodereview.appspot.com/9695048/diff/8037/utils/template/codeg...
utils/template/codegen.dart:69: /*
On 2012/03/15 01:21:25, sigmund wrote:
> delete?

Done.

https://chromiumcodereview.appspot.com/9695048/diff/8037/utils/template/codeg...
utils/template/codegen.dart:100: // List of statement constructors for each var
inside a #each.
On 2012/03/15 01:21:25, sigmund wrote:
> switch to use the same kind of comments here too (like above)

Done.

https://chromiumcodereview.appspot.com/9695048/diff/8037/utils/template/codeg...
utils/template/codegen.dart:234:
statement.add("');\r${spaces}${parentName}.elements.add(${varName});\r");
On 2012/03/15 01:21:25, sigmund wrote:
> 80 col, here and several below in this file

Done.

https://chromiumcodereview.appspot.com/9695048/diff/8037/utils/template/sourc...
File utils/template/source.dart (right):

https://chromiumcodereview.appspot.com/9695048/diff/8037/utils/template/sourc...
utils/template/source.dart:9: class SourceFile implements Comparable {
Yes, see earlier comment on common tokenizer library for css/template.
On 2012/03/15 01:21:25, sigmund wrote:
> looks like you should be able to share this file and some other files from
frog
> using a #source. At least maybe share between css/ and template/?

https://chromiumcodereview.appspot.com/9695048/diff/8037/utils/template/template
File utils/template/template (right):

https://chromiumcodereview.appspot.com/9695048/diff/8037/utils/template/templ...
utils/template/template:71: DART_VM="$BASE_DIR/../../out/Debug_ia32/dart"
I've removed DART_VM and use just dart ...

DartDoc/ApiDoc both assume dart VM is on the $PATH so I assume the same.
On 2012/03/15 01:21:25, sigmund wrote:
> I recommend using Release_ia32 instead, and pass in the flags:
> --enable_type_checks --enable_asserts?

https://chromiumcodereview.appspot.com/9695048/diff/8037/utils/tests/template...
File utils/tests/template/README.txt (right):

https://chromiumcodereview.appspot.com/9695048/diff/8037/utils/tests/template...
utils/tests/template/README.txt:6: name_entry2.tmpl     - simple template
expression inside bunch of nested tags
On 2012/03/15 01:21:25, sigmund wrote:
> 80 col...

Done.

Powered by Google App Engine
This is Rietveld 408576698