Skip to content

Commit

Permalink
fix regex broken by deps; remove babel
Browse files Browse the repository at this point in the history
  • Loading branch information
seangenabe committed Mar 9, 2017
1 parent e8dc5da commit e480b95
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 94 deletions.
12 changes: 0 additions & 12 deletions .babelrc

This file was deleted.

62 changes: 0 additions & 62 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,63 +1 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto

###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp

###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary

###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary

###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
dist/
.nyc_output
coverage
node_modules
Expand Down
3 changes: 0 additions & 3 deletions .npmignore

This file was deleted.

1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
language: node_js
node_js:
- "6.4"
- "6"
- "7"
after_success:
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## The MIT License (MIT)

Copyright © 2014-2016 Sean Genabe <seangenabe@outlook.com>
Copyright © 2014-2017 Sean Genabe <seangenabe@outlook.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
3 changes: 2 additions & 1 deletion lib/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ module.exports = class Parser {
closeRt: ')', // fullwidth right parenthesis
openRb: '((',
closeRb: '))',
autoRb: /[々ヶ\p{Decimal_Number}\p{Block=CJK_Unified_Ideographs}\p{Block=CJK_Unified_Ideographs_Extension_A}\p{Block=CJK_Unified_Ideographs_Extension_B}\p{Block=CJK_Unified_Ideographs_Extension_C}\p{Block=CJK_Unified_Ideographs_Extension_D}\p{Block=CJK_Unified_Ideographs_Extension_E}\p{Block=CJK_Compatibility_Ideographs}\p{Block=CJK_Compatibility_Ideographs_Supplement}]/u.source
// generated from tools/generate-regex.js
autoRb: /[0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u3005\u30F6\u3400-\u4DBF\u4E00-\u9FFF\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uF900-\uFAFF\uFF10-\uFF19\u{104A0}-\u{104A9}\u{11066}-\u{1106F}\u{110F0}-\u{110F9}\u{11136}-\u{1113F}\u{111D0}-\u{111D9}\u{112F0}-\u{112F9}\u{11450}-\u{11459}\u{114D0}-\u{114D9}\u{11650}-\u{11659}\u{116C0}-\u{116C9}\u{11730}-\u{11739}\u{118E0}-\u{118E9}\u{11C50}-\u{11C59}\u{16A60}-\u{16A69}\u{16B50}-\u{16B59}\u{1D7CE}-\u{1D7FF}\u{1E950}-\u{1E959}\u{20000}-\u{2A6DF}\u{2A700}-\u{2CEAF}\u{2F800}-\u{2FA1F}]/u.source
})
}

Expand Down
21 changes: 7 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@
"name": "rubyfy",
"version": "4.0.1-1",
"description": "Easily write ruby annotations and output it as HTML.",
"main": "dist/index.js",
"main": "lib/index.js",
"scripts": {
"compile": "babel lib --out-dir dist",
"test": "nyc ava",
"ava": "ava",
"pretest": "cross-env BABEL_ENV=test npm run compile",
"posttest": "npm run compile",
"coverage": "nyc report --reporter=text-lcov | coveralls"
"coverage": "nyc report --reporter=text-lcov | coveralls",
"generate-regex": "node tools/generate-regex.js"
},
"repository": {
"type": "git",
Expand All @@ -30,16 +28,15 @@
},
"devDependencies": {
"ava": "^0.18.0",
"babel-cli": "^6.18.0",
"babel-plugin-istanbul": "^4.0.0",
"babel-plugin-transform-unicode-property-regex": "^1.0.0",
"bel": "^4.5.0",
"coveralls": "^2.11.15",
"cross-env": "^3.1.3",
"nyc": "^10.0.0"
"nyc": "^10.0.0",
"regenerate": "^1.3.2",
"unicode-9.0.0": "^0.7.0"
},
"engines": {
"node": ">=6.0.0"
"node": ">=6.4.0"
},
"ava": {
"files": [
Expand All @@ -48,9 +45,5 @@
"source": [
"*.js"
]
},
"nyc": {
"sourceMap": false,
"instrument": false
}
}
21 changes: 21 additions & 0 deletions tools/generate-regex.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Generate regex for blocks

const regenerate = require('regenerate')

const CUI = 'CJK_Unified_Ideographs'
const CCI = 'CJK_Compatibility_Ideographs'
const blocks = [
CUI,
...['A', 'B', 'C', 'D', 'E'].map(c => `${CUI}_Extension_${c}`),
CCI,
`${CCI}_Supplement`
]

const set = regenerate(
require(`unicode-9.0.0/General_Category/Decimal_Number/code-points`),
'々',
'ヶ',
...blocks.map(b => require(`unicode-9.0.0/Block/${b}/code-points`))
)

console.log(set.toString({ hasUnicodeFlag: true }))

0 comments on commit e480b95

Please sign in to comment.