Commit Graph

75 Commits

Author SHA1 Message Date
cloudhead
e1062efa98 Overhaul of the error system
The parse() function no longer assumes the command-line is the output
device. We use less.writeError in node.js.
2010-04-25 19:39:21 -04:00
cloudhead
d56feee6f0 Support for pattern-matching on mixin calls. 2010-04-25 00:09:40 -04:00
cloudhead
2ebbf37c4b More accurate parse error messages
Because of the backtracking, we lose the previous point of failure.
The solution is to store the furthest point the parser has parsed to,
when backtracking, and using it when showing parse errors.
2010-04-25 00:06:45 -04:00
cloudhead
1e0cfe9ac1 Reorganized some of the parsing rule order
- Fix for "{" not parsing
- Use some backtracking when necessary,
  it's prettier than crazy lookaheads.
2010-04-21 10:12:29 -04:00
cloudhead
e3df96762e quote 'import' so it doesn't freak out 2010-03-29 22:24:33 -04:00
cloudhead
660d2f76ba fix optimization option wrongly scoped 2010-03-29 22:13:36 -04:00
cloudhead
5c1f326287 no need for context passing 2010-03-22 23:15:25 -04:00
cloudhead
06bf75c3a2 optimization level is taken from env now 2010-03-22 23:13:24 -04:00
cloudhead
823d69fd67 browser.js init -- very basic browser support - Makefile also builds for browser now 2010-03-22 23:12:58 -04:00
cloudhead
d0b6573017 refactored the import mechanism, added some doc 2010-03-22 20:59:49 -04:00
cloudhead
2b4b0cbdf6 made parser reentrant for import support 2010-03-21 19:17:37 -04:00
cloudhead
38ffbb40ac allow for operations with no spaces, such as '4+5' 2010-03-19 18:46:42 -04:00
cloudhead
4bbc382300 refactored operand(), and take away parsing of -() 2010-03-19 18:05:36 -04:00
cloudhead
e7954adcc0 refactored rule() cause the closure slows things down too much for some reason 2010-03-19 17:56:43 -04:00
cloudhead
4ae9e31c40 parse() is now asynch, and uses a callback 2010-03-19 17:50:35 -04:00
cloudhead
d08072d0dd Parse @import properly. 2010-03-18 18:13:02 -04:00
cloudhead
8812c45c77 fixed scope problem in parser 2010-03-18 14:49:10 -04:00
cloudhead
854f65f079 Refactored parsers.rule 2010-03-13 20:15:44 -05:00
cloudhead
61a7b2e9e7 Added lots more documentation to the parser 2010-03-13 20:14:44 -05:00
cloudhead
fe732e843c refactor of module system. Things work properly now, and it's all much cleaner. 2010-03-13 03:34:48 -05:00
cloudhead
e0623094fa part 2 of the comment pass 2010-03-12 15:03:05 -05:00
cloudhead
9c84b50d5b we need to make sure we're not eating a '-' in the operation parsing, it fucks up our generation of functions which start with a - 2010-03-11 15:36:32 -05:00
cloudhead
8adac6569e output directives properly 2010-03-11 15:35:23 -05:00
cloudhead
553aaecf6a font property parsing, mainly the 'small/12px' part. 2010-03-11 15:34:57 -05:00
cloudhead
c4413facad did some refactoring in the parser, so we don't need to pass variables
to the $() function anymore. We also don't need to pass arrays around.
2010-03-08 23:45:57 -05:00
cloudhead
23775bda9b implemented dynamic mixins 2010-03-07 18:49:54 -05:00
cloudhead
2b0853de81 comments, wooh! 2010-03-06 17:53:55 -05:00
cloudhead
7b151447b1 peek() can take a string too now 2010-03-05 21:51:45 -05:00
cloudhead
289a775e83 simplified rule regex 2010-03-05 21:45:23 -05:00
cloudhead
b2d242ba39 some optimizations to make the parser run faster 2010-03-05 21:08:41 -05:00
cloudhead
0af5632531 renamed string to quoted, to match the node 2010-03-05 14:56:27 -05:00
cloudhead
cd5bddff99 when parsing a string, capture the content too 2010-03-05 14:55:21 -05:00
cloudhead
476581f77a getting combinators to output properly. some little hacks, but it beats having a white-space sensitive grammar 2010-03-05 11:39:39 -05:00
cloudhead
b4f3e9029c output strings in attribute selectors properly 2010-03-04 16:13:48 -05:00
cloudhead
4767b264e7 basic mixins with namespaces working. swoosh. 2010-03-03 21:21:32 -05:00
cloudhead
e9c6645b2c end rule 2010-03-03 12:01:17 -05:00
cloudhead
e6c5c57755 inverse style to stylize 2010-03-03 12:01:06 -05:00
cloudhead
efab821115 parse mixins, including namespace. For now, lets focus on one mixin per rule 2010-03-03 12:00:55 -05:00
cloudhead
14bc6def86 a little clearer ParseError output 2010-03-03 11:59:30 -05:00
cloudhead
76eb332b24 Use anonymous functions for the parsers.. It saves us some file size. 2010-03-02 14:58:06 -05:00
cloudhead
f70f6a542c merge node->tree changes 2010-03-01 19:47:32 -05:00
cloudhead
5ee0209e8a don't use Usage: node [options] script.js [arguments]
-v, --version      print node's version
  --debug[=port]     enable remote debugging via given TCP port
  --debug-brk[=port] as above, but break in node.js and
                     wait for remote debugger to connect
  --cflags           print pre-processor and compiler flags
  --v8-options       print v8 command line options

Documentation can be found at http://nodejs.org/api.html or with 'man node', as it's, um, used by node. Use  instead. Also moved tree.node requires in tree.js
2010-03-01 15:32:21 -05:00
cloudhead
f0c00ab2b4 create an empty Combinator if none was specified. Refactored Combinator generation, and added + ~ :: 2010-02-28 12:49:08 -05:00
cloudhead
35b452bf00 error = null, when starting a parse 2010-02-28 01:07:13 -05:00
cloudhead
1e16d0233c ParseErrors dont raise an exception anymore, we just set parser.error to the value of the error 2010-02-27 14:14:52 -05:00
cloudhead
bd88ab89ef optimize dimension parsing, also fixes weird bug 2010-02-26 22:31:26 -05:00
cloudhead
fd8aa91ddc improved the chunkification process, and gave different options, as well as an option not to chunkify, through the optimization setting. The ideal split is now \n} 2010-02-26 16:34:49 -05:00
cloudhead
d97b30d9cc replace \r\n with \n 2010-02-26 14:50:26 -05:00
cloudhead
3ce2d7ad19 handle missing ; before a } 2010-02-26 14:49:07 -05:00
cloudhead
0c00a9c8ac handle empty property values 2010-02-26 14:48:32 -05:00