Giter VIP home page Giter VIP logo

Comments (10)

TylerBrinks avatar TylerBrinks commented on August 15, 2024

I'm perfectly happy to take a pull request.

Date: Thu, 20 Sep 2012 14:14:29 -0700
From: [email protected]
To: [email protected]
Subject: [ExCSS] Space in font names lost (#6)

A CSS like this:

body

{

font: normal 100% Frutiger, "Frutiger Linotype" , Univers, Calibri, "Gill Sans" , "Gill Sans MT" , "Myriad Pro" , Myriad, "DejaVu Sans Condensed" , "Liberation Sans" , "Nimbus Sans L" , Geneva, "Helvetica Neue" , Helvetica, Arial, sans-serif;

}

after parsed will have font names without spaces, like FrutigerLinotype.

What can I do?

          —

          Reply to this email directly or view it on GitHub.

from excss.

Piedone avatar Piedone commented on August 15, 2024

Well, if you pinpoint me where to look for the issue I can make a try :-).

from excss.

TylerBrinks avatar TylerBrinks commented on August 15, 2024

It's hard to know just where to point you. Sadly, Coco/r is not white space sensitive. There are a few functions at the top of the ATG file that try to help where Coco/r fails. Probably the best place to look would be the unit tests. You'll see tests for most areas of the code base. I'd add one that fails and then see on or about what area of the parser causes the trouble. I've done what I can to document the ATG file so it can be tracked down.

I hope that's clear enough. I'll try the doing same and share my findings. Another pair of eyes is always better!

Date: Thu, 20 Sep 2012 14:40:56 -0700
From: [email protected]
To: [email protected]
CC: [email protected]
Subject: Re: [ExCSS] Space in font names lost (#6)

Well, if you pinpoint me where to look for the issue I can make a try :-).

          —

          Reply to this email directly or view it on GitHub.

from excss.

Piedone avatar Piedone commented on August 15, 2024

Oh damn, I forgot the parser was generated from Coco/r... The problem is that this is completely foreign to me. Nevertheless I'll look at the places you advised.

from excss.

TylerBrinks avatar TylerBrinks commented on August 15, 2024

Yea - not exactly an easy "language" to learn. Attributed Grammar is... interesting. My hope in the long run is to either switch to a more readable and white space friendly parser like Ragel, or try to port Chrome's CSS Engine. Chrome uses a parses as well, but for their lower level C/C++ code.

Date: Wed, 26 Sep 2012 14:11:12 -0700
From: [email protected]
To: [email protected]
CC: [email protected]
Subject: Re: [ExCSS] Space in font names lost (#6)

Oh damn, I forgot the parser was generated from Coco/r... The problem is that this is completely foreign to me. Nevertheless I'll look at the places you advised.

          —

          Reply to this email directly or view it on GitHub.

from excss.

Piedone avatar Piedone commented on August 15, 2024

I forked the project and after managing to build it (due to the path containing spaces the copy command initially failed, thus building too) I can't run the tests with the TestDriven.Net plugin (it starts, then immediately finishes and says that run = failed = succeeded = 0 tests...). Is there some special config needed?

from excss.

Piedone avatar Piedone commented on August 15, 2024

Now I started experimenting around by simply running the project with a test console app. It turns out that if the font names are not in quotes the spaces remain. Since the quoted version is also valid CSS, the problem remains, however.
I digged around a bit with the debugger, here are my findings:
Probably root of the problem is that a space-separated, quote font name is recognized as two tokens. Its parsing goes through Parser.QuotedStringPreserved() and since there tokens are concatenated on ln 403 the space goes away. The root of this is that in Scanner.NextToken() ln 397 if the current character is a space the expression returns false, so on ln 398 the value of the variable t will be a token only containing the first part of the font name.
What do you think?

from excss.

Piedone avatar Piedone commented on August 15, 2024

Hi, any updates on this?

from excss.

TylerBrinks avatar TylerBrinks commented on August 15, 2024

I have a bit of update - more of a change in direction. I've reached the end of what Coco/r is capable of. It's simply not the right tool for the job given it's inability to parse white space properly. I'm working on converting the whole project over to use Ragel as the lexer generator.

from excss.

Piedone avatar Piedone commented on August 15, 2024

Oh wow. Thanks for the update, this looks great.
Any estimate on when you can complete the converting?

from excss.

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.