From c9627040ccc74919af59a7602decf7797ef01085 Mon Sep 17 00:00:00 2001 From: Mohamed Abdelnour Date: Sat, 29 May 2021 02:21:24 +0200 Subject: [PATCH] Add CoffeeScript syntax test file --- .../CoffeeScript/coffeescript.coffee | 391 ++++++++++++++++++ .../source/CoffeeScript/LICENSE.md | 26 ++ .../source/CoffeeScript/coffeescript.coffee | 391 ++++++++++++++++++ 3 files changed, 808 insertions(+) create mode 100644 tests/syntax-tests/highlighted/CoffeeScript/coffeescript.coffee create mode 100644 tests/syntax-tests/source/CoffeeScript/LICENSE.md create mode 100644 tests/syntax-tests/source/CoffeeScript/coffeescript.coffee diff --git a/tests/syntax-tests/highlighted/CoffeeScript/coffeescript.coffee b/tests/syntax-tests/highlighted/CoffeeScript/coffeescript.coffee new file mode 100644 index 00000000..731ce911 --- /dev/null +++ b/tests/syntax-tests/highlighted/CoffeeScript/coffeescript.coffee @@ -0,0 +1,391 @@ +# CoffeeScript can be used both on the server, as a command-line compiler based +# on Node.js/V8, or to run CoffeeScript directly in the browser. This module +# contains the main entry functions for tokenizing, parsing, and compiling +# source CoffeeScript into JavaScript. + +{Lexer} = require './lexer' +{parser} = require './parser' +helpers = require './helpers' +SourceMap = require './sourcemap' +# Require `package.json`, which is two levels above this file, as this file is +# evaluated from `lib/coffeescript`. +packageJson = require '../../package.json' + +# The current CoffeeScript version number. +exports.VERSION = packageJson.version + +exports.FILE_EXTENSIONS = FILE_EXTENSIONS = ['.coffee', '.litcoffee', '.coffee.md'] + +# Expose helpers for testing. +exports.helpers = helpers + +# Function that allows for btoa in both nodejs and the browser. +base64encode = (src) -> switch + when typeof Buffer is 'function' + Buffer.from(src).toString('base64') + when typeof btoa is 'function' + # The contents of a `