- Verify that IndentTokenizer works with a non-LINE-based tokenizer specification, rather than the default
- Resurrect the 'NEWLINE' token, as we need it to be as picky about the file format as the current parser is
- Implement a parser which leverages this to properly change the lexer states for both ordinary functions and "def" syntax functions. Determine if this should be custom or PLY or codetalker or what, by first determining whether these libraries would support a lexer like ours
- Do performance testing comparing the new parser against the old, and against the pyparsing implementation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
sys.path[0:0] = ["./lib"] | |
import bb.data | |
import lupa | |
lua = lupa.LuaRuntime() | |
env = lua.eval("setmetatable({}, {__index = _G})") | |
setfenv = lua.globals().setfenv | |
def eval_lua(luastr, d): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright Mike Sweeney, placed under the MIT license | |
# See http://code.activestate.com/recipes/577701-a-flexible-state-machine-class/ for reference | |
class StateMachine: | |
def __init__(self, transitions, initial=None): | |
if isinstance(transitions, basestring): | |
components = [term.split(':') for term in transitions.split()] | |
self.sm = dict([tuple(a.split(',')), tuple(b.split(','))] | |
for a, b in components) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env lua5.0 | |
-- A Factory generates an object that is able to construct other objects, | |
-- via the :new() method. Note that it does NOT do anything with metatables. | |
-- That is up to the appropriate init() function. | |
-- As a simple example, a Class is essentially an object factory, with fancy | |
-- initialization for its subclasses for inheritence. | |
-- | |
-- local Class = Factory(Object, Object) | |
-- Class.class = Class |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Pre-fetching sources into DL_DIR | |
d = oe.data.DataStore(d) | |
for uri in (oe.fetcher(uri, d.DL_DIR) for uri in d.SRC_URI): | |
try: | |
uri.cache() | |
except oe.FetchError as exc: | |
bb.fatal(str(exc)) | |
# Downloading sources into WORKDIR | |
d = oe.data.DataStore(d) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INCOMPATIBLE_LICENSE ?= "" | |
LICENSE_PRIORITY = "\ | |
MIT \ | |
LGPL-2.0 LGPL-2.1 \ | |
GPL-2.0 GPL-2.0 \ | |
* \ | |
LGPL-3.0 GPL-3.0 \ | |
Proprietary CLOSED \ | |
${INCOMPATIBLE_LICENSE} \ | |
" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# The interactive part of pstats.py from the python source, modified slightly to allow | |
# multiple profile data files as arguments. It initializes the stats object with the | |
# first argument, then adds the data from the others to that object. | |
import sys | |
from pstats import Stats | |
import cmd | |
try: |
This is just some experimentation with bitbake-like things from scratch in go
To test:
export GOPATH=$HOME/code/go # or similar, if not set already
go get github.com/skelterjohn/go-gb/gb
export PATH=$GOPATH/bin:$PATH
gb
./test/test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git i/lib/bb/parse/ast.py w/lib/bb/parse/ast.py | |
index eae840f..2fa5664 100644 | |
--- i/lib/bb/parse/ast.py | |
+++ w/lib/bb/parse/ast.py | |
@@ -102,13 +102,23 @@ class DataNode(AstNode): | |
bb.data.update_data(e) | |
val = e.expand(groupd["value"], key + "[:=]") | |
elif "append" in groupd and groupd["append"] != None: | |
- val = "%s %s" % ((self.getFunc(key, data) or ""), groupd["value"]) | |
+ val = self.getFunc(key, data) or "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
time=+6 # older than 7 days ago | |
cache_paths () { | |
locate -ebr '^cached-binaries\|sstate-cache$' | |
echo /cache/sstate | |
} | |
readlinks () { |