Skip to content

Instantly share code, notes, and snippets.

View matthewd's full-sized avatar

Matthew Draper matthewd

View GitHub Profile
From a93dc9af9c6ebba6d375aed61ca0ee67f75d14b2 Mon Sep 17 00:00:00 2001
From: Matthew Draper <matthew@trebex.net>
Date: Wed, 26 Jan 2011 15:39:24 +1030
Subject: [PATCH] Remove Success/Fail structs
---
lib/parslet/atoms/alternative.rb | 2 +-
lib/parslet/atoms/base.rb | 30 +++++-------------------------
lib/parslet/atoms/lookahead.rb | 2 +-
lib/parslet/atoms/named.rb | 9 +++++----
From e69827d6fbfa919387fbc0dbb15ba5079d2ea947 Mon Sep 17 00:00:00 2001
From: Matthew Draper <matthew@trebex.net>
Date: Tue, 25 Jan 2011 10:47:02 +1030
Subject: [PATCH] Search backwards rather than forwards.
Most of the time, we're looking at values around the end of what we've
parsed.
---
lib/parslet/source.rb | 19 ++++++++++---------
1 files changed, 10 insertions(+), 9 deletions(-)
bin/mspec ci --background --agent
rubinius 1.3.0dev (1.8.7 d118774d xxxx-xx-xx JI) [x86_64-unknown-linux-gnu]
.................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Failed to match sequence (SP? SOURCE_ELEMENTS SP?) at line 1 char 1.
`- Failed to match sequence (SP? SOURCE_ELEMENTS SP?) at line 1 char 1.
`- Failed to match sequence (SOURCE_ELEMENT (SP? SOURCE_ELEMENT){0, }) at line 1 char 1.
`- Expected one of [FUNCTION_DECLARATION, STATEMENT]. at line 1 char 1.
|- Failed to match sequence ('function' SP IDENT SP? '(' SP? (FORMAL_PARAMETER_LIST SP?)? ')' SP? '{' SP? FUNCTION_BODY SP? '}') at line 1 char 1.
| `- Expected "function", but got "var x = " at line 1 char 1.
`- Expected one of [BLOCK, VARIABLE_STATEMENT, CONST_STATEMENT, EMPTY_STATEMENT, EXPR_STATEMENT, IF_STATEMENT, ITERATION_STATEMENT, CONTINUE_STATEMENT, BREAK_STATEMENT, RETURN_STATEMENT, WITH_STATEMENT, SWITCH_STATEMENT, LABELLED_STATEMENT, THROW_STATEMENT, TRY_STATEMENT]. at line 1 char 1.
|- Failed to match sequence ('{' SP? SOURCE_ELEMENTS SP? '}') at line 1 char 1.
| `- Expected "{", but got "v" at line 1 char 1.
|- Failed to matc
tango:src/rbx[daedalus]% ./configure
Configuring LLVM...
Checking for existing LLVM tree: found!
Checking sizeof(long): 8 bytes
Checking platform endianness: little endian
Checking tr1/hash definition: found
Checking for function 'backtrace': found!
Checking for function 'readline': found!
Checking curses library: curses
require 'keylog'
keylog = "qqY2pdfrct,Take one down and pass it around\e\x18$Po\ej\x18w\x18q81@qdkcf0Go to the store and buy some more, 99\ekex?s\rxnxZZ"
p keylog
vimmish = Keylog.new.convert(keylog)
p vimmish
require 'strscan'
class Keylog
def convert(input)
output = ""
scan(input) {|s| output << s }
output
end
def count_keys(input)
keys = 0
From 3b189997274ff067a43a7509b4a35a818d6c01d9 Mon Sep 17 00:00:00 2001
From: Matthew Draper <matthew@trebex.net>
Date: Wed, 29 Dec 2010 00:14:57 +1030
Subject: [PATCH] Regexp literals raise a SyntaxError.
---
kernel/common/regexp.rb | 6 ++++++
lib/compiler/ast/literals.rb | 2 +-
spec/compiler/match2_spec.rb | 2 +-
spec/compiler/match3_spec.rb | 2 +-
i=0
j=0
10000.times do
i.upto(10000) do |x|
j+=x
end
end
puts j
From e925fe3d38d907d57c46e53809d0252929b3b9fd Mon Sep 17 00:00:00 2001
From: Matthew Draper <matthew@trebex.net>
Date: Wed, 22 Dec 2010 20:04:35 +1030
Subject: [PATCH 1/3] Use UTC in XML timestamps, to avoid duelling regenerations.
---
web/_site/feed/atom.xml | 4 ++--
web/feed/atom.xml | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)